Find intermediate values between two known points using linear interpolation or extrapolation.
Last updated: April 2026 | By Patchworkr Team
Linear interpolation is a method for estimating a value between two known data points by assuming the relationship is linear. Given two points (x₀, y₀) and (x₁, y₁), interpolation finds the y-value for any x between them using the formula: y = y₀ + (y₁ − y₀) × (x − x₀) / (x₁ − x₀). This straightforward technique is widely used in computer graphics, data analysis, and engineering to estimate missing values, smooth curves, and create transitions between known data points. When x falls outside the range [x₀, x₁], the method becomes extrapolation, which is generally less reliable but still mathematically valid.
Linear interpolation is foundational in countless applications: animation systems use it to transition values over time, geographic information systems interpolate elevation data, engineers use it to estimate material properties, and scientists apply it to convert between measurement scales. The method assumes a perfectly linear relationship, so it works best when the underlying data is actually linear or nearly so. For curved or nonlinear data, more sophisticated interpolation methods like polynomial or spline interpolation may provide better accuracy, but linear interpolation remains the go-to choice for simplicity, speed, and when data is genuinely linear.
Start with two data points (x₀, y₀) and (x₁, y₁) where the relationship is known or assumed linear.
Why: Two distinct points define a unique line. The relationship between them establishes the interpolation foundation.
Choose the x-value for which you want to estimate y. For best results, keep it between x₀ and x₁ (interpolation rather than extrapolation).
Why: Interpolation (within range) is more reliable than extrapolation (outside range). Values inside the range rest on observed data; outside values rely on assumptions.
Calculate: y = y₀ + (y₁ − y₀) × (x − x₀) / (x₁ − x₀). This gives the estimated y-value.
Why: This formula computes the proportional position of your target x between the two known points, then applies that proportion to the y-interval.
The calculated y is your estimate. Remember it assumes linearity; the actual value may differ if the true relationship is nonlinear.
Why: Linear interpolation doesn't account for curves or acceleration. Understanding this limitation prevents over-confidence in estimates.
Check that your result makes sense given the two original points. The interpolated value should be between y₀ and y₁ if x is between x₀ and x₁.
Why: This verification catches calculation errors. If the result is outside the expected range, an arithmetic mistake likely occurred.
Estimating Temperature at Noon
Estimated temperature at noon
Interpolation estimates between two points; extrapolation estimates outside the range. Interpolation is more reliable.
It’s accurate only if the true relationship is linear. For curved data, results are approximations.
No, you need at least two points to determine a line. One point isn’t enough to define a relationship.
They can’t be; this would create division by zero. You need two distinct points.
Use piecewise linear interpolation: apply linear interpolation to the nearest two points to your target x.
Yes, constantly. It smoothly transitions object positions, colors, and properties over time.
Polynomial, cubic spline, or other interpolation methods fit curved data more accurately.
Yes, if y decreases as x increases. The slope can be any real number.
Related Tools
Calculate average rate of change.
Calculate bilinear interpolation.
Calculate binocular range.
Calculate conic sections.
Calculate coordinate grid properties.
Calculate mirror equation.