Linear Interpolation Calculator
Estimate a value between two known data points using linear interpolation. Enter the two known points and the x-value you want to evaluate. For instance, if you know y = 10 at x = 1 and y = 30 at x = 5, the interpolated value at x = 3 is 20.
The Linear Interpolation Formula
Given two known points (x0, y0) and (x1, y1), the interpolated value at x is:
y = y0 + (x - x0) x (y1 - y0) / (x1 - x0)
This is sometimes written as LERP(t) = a + t(b - a), where t is the fraction of the way from point 0 to point 1.
Step-by-step Example
Known points: (2, 100) and (6, 300). Find y at x = 4.
- Slope: (300 - 100) / (6 - 2) = 200 / 4 = 50
- Interpolated y: 100 + (4 - 2) x 50 = 100 + 100 = 200
- Fraction along interval: (4 - 2) / (6 - 2) = 0.5 (50%)
When to Use Linear Interpolation
- Estimating values between readings in a data table
- Computer graphics and animation (smoothly blending between positions)
- Engineering calculations between tabulated material properties
- Anywhere you need a quick estimate between two known values
Limitations
Linear interpolation assumes a straight line between points. If the underlying relationship is curved (exponential, logarithmic, etc.), the estimate will be less accurate. For curved data, consider polynomial or spline interpolation.