Algebra
Interpolation from the slope
Walk along the line from the first point using the slope between the two known points.
The Formula
y = y1 + (x - x1) x (y2 - y1) / (x2 - x1)
Walk along the line from the first point using the slope between the two known points.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| y | Interpolated value | same as y1 | The value at the target input. |
| x | Target input | same as x1 | The input you want a value for. |
| x1, y1 | Lower point | same as inputs | The known point below the target. |
| x2, y2 | Upper point | same as inputs | The known point above the target. |
What Each Symbol Means
ysame as y1
Interpolated value
The value at the target input.
xsame as x1
Target input
The input you want a value for.
x1, y1same as inputs
Lower point
The known point below the target.
x2, y2same as inputs
Upper point
The known point above the target.
See It Worked With Real Numbers
A formula on its own does not tell you which number goes where. The how to calculate linear interpolation page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.
Where This Formula Appears
This equation is the working core of How To Calculate Linear Interpolation, filed under Math. Every number the guide produces comes from substituting into this one line.