Calculator · Engineering Mathematics
Linear Interpolation Calculator
Read a value between two known points along the straight line that joins them. The simplest interpolation there is, and the one behind every printed engineering table.
Problem definition
x₁ < x₀ is accepted and describes the same line. A target outside [x₀, x₁] is computed but reported as extrapolation.
Results
| Estimate y(4) | 10 |
|---|---|
| Method | Linear (two points) |
| Status | Interpolation — inside the data span |
| Data points | 2 |
| Data span | [0, 10] |
| Interval used | [0, 10] |
| Slope on that interval | 2.5 |
| Fraction t along the interval | 0.4 |
The line and the target
Target x = 4
- Target x10
Continue
Both points and the target continue into the Lab with Piecewise Linear enabled. No reference function is carried over, because this calculator does not have one.
Assumptions & validity
- · x₀ ≠ x₁ — two points sharing an abscissa define no line and are refused.
- · Both coordinates of both points must be finite.
- · The straight line is an assumption about the data, not a property of it: nothing here checks that the underlying quantity is linear.
- · Outside [x₀, x₁] the same line is continued. That is extrapolation and is labelled as such; the data says nothing there.
- · No error estimate is produced. Without an assumed bound on the second derivative there is no honest remainder term.
Technical reference
t = (x − x₀) / (x₁ − x₀)
y = y₀ + t (y₁ − y₀)
equivalently y = y₀ + m (x − x₀), m = (y₁ − y₀)/(x₁ − x₀)
Remainder for f ∈ C² on the interval: f(x) − y = f″(ξ)(x − x₀)(x − x₁)/2 for some ξ between the nodes
- x₀, y₀
- first known point
- x₁, y₁
- second known point
- t
- fraction of the way from the first point to the second[–]
- m
- slope of the line through the two points
- ξ
- an unknown point between the nodes, from the mean value theorem
t = 0 returns y₀ and t = 1 returns y₁ exactly; 0 < t < 1 is interpolation and anything else is extrapolation.
The formula is exact whenever the underlying data really is linear — then the line through any two of its points is the data itself.
The remainder above only exists if f is twice continuously differentiable between the nodes. For measured data with no assumed smoothness there is no error bound at all, which is why none is shown.
The remainder vanishes at both nodes, but it is NOT generally largest at the midpoint: f″(ξ) varies across the interval. What is true is the bound — if |f″| ≤ M throughout, then |f(x) − y| ≤ (M/2)·|(x − x₀)(x − x₁)|, and it is that GEOMETRIC FACTOR |(x − x₀)(x − x₁)| which is maximal at the midpoint.
Exchanging the two points changes nothing: the slope m = (y₁ − y₀)/(x₁ − x₀) keeps its sign, because numerator and denominator both change sign, and the interpolated value is identical. Only the local coordinate is relabelled, t → 1 − t.