LifeTally
HomeAll calculators

LifeTally

Linear interpolation between two points

What y lies on the straight segment between your two points at a chosen x?

Enter two coordinate pairs and an x within their interval. Find the interpolated value, relative position and slope.

Your points and target

Use one unit basis for all x values and one for both y values; the two axes may use different units. Slope has y-units per x-unit. All fields allow signed decimals. Enter fractions as decimals, not a/b.

How the estimate works

For distinct x₀ and x₁, t = (x − x₀) ÷ (x₁ − x₀), y = (1 − t)y₀ + ty₁ and m = (y₁ − y₀) ÷ (x₁ − x₀). Only 0 ≤ t ≤ 1 is accepted. t = 0 is the first point and t = 1 the second, even when x₁ < x₀. Position does not need y values; slope does not need the target x. An interior y needs both y values.

t = (x − x₀) ÷ (x₁ − x₀); 0 ≤ t ≤ 1
y = (1 − t)y₀ + ty₁
m = (y₁ − y₀) ÷ (x₁ − x₀)

This assumes a straight connection between two points; two measurements do not prove that the real relationship is linear. No extrapolation, regression, uncertainty estimate, data validation, calibration, safety advice, logarithmic/spline/multiple-point interpolation or real prediction guarantee. No plot is generated.

NIST DLMF: Lagrange interpolation ↗
OpenStax: slope and equations through two points ↗

Check the filled example

Our chosen example: (x₀,y₀) = (2,10), (x₁,y₁) = (8,−2), x = 5. The target is halfway: t = 0.5, y = 4 and m = −2. Reversing the points keeps y and slope but reverses the meaning of t. These are mathematical inputs, not a norm or forecast.

Accepted input values

First x₀
2
First y₀
10
Second x₁
8
Second y₁
-2
Target x
5

Plan the next step

Use the standard calculator for separate operations. Choose interpolation only when a straight connection is the model you intend.

Open the standard calculator →