Linear Interpolation
Given (xโ,yโ) and (xโ,yโ), interpolate at x: y = yโ + (xโxโ)ยท(yโโyโ)/(xโโxโ). Same as lerp. Linear between two points. Exact at endpoints.
Did our AI summary help? Let us know.
Lerp: y = (1โt)yโ + tยทyโ where t โ [0,1]. At x=xโ: y=yโ; at x=xโ: y=yโ. Bilinear extends to 2D with four corners.
Ready to run the numbers?
Why: Linear interpolation estimates values between known data points. Used in animation (lerp), numerical methods, and signal processing. Foundation for bilinear and spline interpolation.
How: y = yโ + (xโxโ)ยท(yโโyโ)/(xโโxโ). Requires xโโ xโ. Or: t=(xโxโ)/(xโโxโ), y=(1โt)yโ+tyโ. For x outside [xโ,xโ], it's extrapolation.
Run the calculator when you are ready.
Enter Known Points and Target x
First Known Point
Second Known Point
For educational and informational purposes only. Verify with a qualified professional.
๐งฎ Fascinating Math Facts
y = yโ + (xโxโ)ยท(yโโyโ)/(xโโxโ).
โ Numerical Methods
Lerp: (1โt)yโ + tยทyโ, t=(xโxโ)/(xโโxโ).
โ Formula
Key Takeaways
- โข Linear interpolation assumes a straight line between two known points.
- โข The formula is exact at the endpoints.
- โข When is between and , it is interpolation; outside is extrapolation.
- โข The method is also called lerp (linear interpolation) in computer graphics.
- โข For higher accuracy, use spline or polynomial interpolation.
Did You Know?
Lerp is used for color gradients, animations, and smooth transitions between keyframes.
Fills missing data points or creates evenly spaced samples from irregularly spaced data.
Engineers use it to approximate values in steam tables and material property tables.
Yield curves and pricing models often use linear interpolation between known values.
Game engines use lerp for smooth movement, camera transitions, and UI animations.
Bilinear and trilinear interpolation extend this concept to 2D and 3D.
Understanding Linear Interpolation
Linear interpolation estimates the value of a function at a point by using the values at surrounding known points. It assumes a straight-line relationship between adjacent points.
Expert Tips
Interpolation vs Extrapolation
Interpolation (x between xโ and xโ) is more reliable than extrapolation (x outside the range).
Avoid Division by Zero
Ensure xโ โ xโ. If they are equal, the line is vertical and the formula is undefined.
Weighted Average
The result is a weighted average of yโ and yโ, where weights depend on distance from x.
Higher-Order Methods
For curved functions, consider cubic spline or polynomial interpolation.
Frequently Asked Questions
What is linear interpolation?
Linear interpolation estimates the y-value at a point x by assuming a straight line between two known points (xโ, yโ) and (xโ, yโ).
When is it interpolation vs extrapolation?
Interpolation: x is between xโ and xโ. Extrapolation: x is outside this range. Extrapolation is less reliable.
When is linear interpolation exact?
It is exact at the endpoints: if x = xโ, then y = yโ; if x = xโ, then y = yโ.
What if xโ equals xโ?
The formula is undefined. The two points must have different x-coordinates.
When is linear interpolation inaccurate?
When the underlying function is highly curved between the known points.
What is bilinear interpolation?
An extension to 2D: interpolate in both x and y directions using four corner values.
Where is lerp used in programming?
In game engines, graphics, and animation for smooth transitions between values.
How to Use This Calculator
- Enter two known points (xโ, yโ) and (xโ, yโ).
- Enter the target x-value where you want the interpolated y.
- Click "Calculate" to get the result.
- Use sample examples to load preset inputs.
Disclaimer: Linear interpolation assumes a straight-line relationship. For curved data, use higher-order methods. Results are for educational and general use.
Related Calculators
Bilinear Interpolation Calculator
Bilinear Interpolation Calculator - Calculate and learn about coordinate-geometry concepts
MathematicsCentroid Calculator
Centroid Calculator - Calculate and learn about coordinate-geometry concepts
MathematicsEndpoint Calculator
Endpoint Calculator - Calculate and learn about coordinate-geometry concepts
MathematicsGradient Calculator
Gradient Calculator - Calculate and learn about coordinate-geometry concepts
MathematicsRotation Calculator
Rotation Calculator - Calculate and learn about coordinate-geometry concepts
MathematicsVector Calculator
Vector Calculator - Calculate and learn about coordinate-geometry concepts
Mathematics