Skip to content
Saha Hesap

Linear Interpolation and Extrapolation

Find y at an x value between or beyond two known points, together with the slope and relative position.

Interpolating between two points

A straight line joins the known points and supplies y for the target x. The line through (0,10) and (10,30) has slope 2, so x=5 gives y=20. Reversing the order of the two points does not change the result. Equal x coordinates cannot define this calculation as a function y(x).

Extending the line

A relative position between 0 and 1 means interpolation. At either endpoint the known value is returned. A position below 0 or above 1 means extrapolation. In the example, x=15 gives y=40. This simply extends the line and does not show that the actual system keeps the same slope. The tool does not fit curves, perform statistical regression or calculate uncertainty or confidence intervals. Use consistent units for each coordinate. Very close large x values have limited numerical precision.

Estimate within a table interval

Choosing the two rows surrounding the target can be more meaningful than using distant table endpoints. Even then, a straight line between measurements is a modelling choice. The calculator does not prove that the relationship is linear. The x axis may represent temperature, time or another quantity. Both x values must describe the same kind of quantity, and both y values must also be consistent.

Choose x₁ = 20, y₁ = 80, x₂ = 60 and y₂ = 100. At x = 30, the fraction of the horizontal interval is 10/40 = 0.25. The total vertical change is 20, so the increase is 0.25 × 20 = 5 and the result is 85. The slope is 20/40 = 0.5. No units are assigned in this example. With units assigned, slope has y units divided by x units.

When swapping points, move each coordinate pair together. Swapping only x values creates another line. Rounded table values can limit accuracy. Many output digits do not imply equally precise measurements. An interval containing a physical threshold, phase transition or discontinuity requires separate consideration before using a single line.

Frequently asked questions

How do you estimate a sine value with linear interpolation?

For example, sine values 0 at 0° and 1 at 90° give a linear interpolation estimate of 0.3333 at 30°. Draw a straight line between the endpoints, noting that the sine curve is not linear, so this estimate falls clearly below the true sine value and the error grows over wide intervals.

Calculate with these values

Related calculators

Found a mistake or something missing?

If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.

Send an email