Advertisement

Linear interpolation calculator

Enter the two reference points and choose the unknown. The model is a straight line through both points.

Calculator

Requested value
20.00000000
Line slope
2.00000000
Line intercept
10.00000000
Target position
Interpolation, including endpoints

Advertisement

How this calculator works

Two distinct x coordinates define a linear model. The target position along the x interval supplies the same fraction of the change in y. Reverse modes rearrange this relation to recover a target x or one missing reference coordinate. A zero coefficient means the inverse is not unique and is rejected. Values outside the reference interval are extrapolations, which may be poor estimates of a curved relationship.

Formula

y = y1 + (x - x1)(y2 - y1)/(x2 - x1); m = (y2-y1)/(x2-x1); b = y1 - m x1.

Worked example

Between (0, 10) and (10, 30), x = 5 is halfway along the interval, so y = 20. The line has slope 2 and intercept 10. At x = 15 it extrapolates to y = 40.

Advertisement

Frequently asked questions

Can the points be entered backwards?

Yes. Reversing both point pairs leaves the line and estimate unchanged.

Why reject equal x coordinates?

They cannot define y as a single-valued linear function of x.

Is interpolation exact?

It is exact for the straight-line model. Real data between observations may follow a different curve.

Sources

Advertisement