Linear Interpolation Calculator with Slope, Interpolation Ratio & Validation
Calculate interpolated value using x<sub>1</sub>, x<sub>2</sub> and query point based on linear interpolation.
Enter the known values and review the calculated result
Input parameters
Use consistent values and select the intended engineering units.
Interpolation points
Interpolation query
Neighbor points [Optional]
Options
Results
Engineering Pro Save, document and continue this calculation
Turn this result into a reusable engineering record with saving, PDF export and reporting workflows.
Method, application and limitations
Review the calculation method, intended application and engineering assumptions before using the result in a design decision.
Formula and calculation method
Interpolated value formula:
If x2 < x1, the calculator swaps the two interpolation points:
x1 ↔ x2, y1 ↔ y2
Δx = x2 − x1
Δy = y2 − y1
k = Δy / Δx
λ = (x − x1) / Δx
y = y1 + λ · Δy
Advanced normalization mode:
xmid = 0.5 · (x1 + x2)
ymid = 0.5 · (y1 + y2)
xscale = max(|x1 − x2|, 1)
yscale = max(|y1 − y2|, 1)
x1,n = (x1 − xmid) / xscale
x2,n = (x2 − xmid) / xscale
y1,n = (y1 − ymid) / yscale
y2,n = (y2 − ymid) / yscale
xn = (x − xmid) / xscale
Δxn = x2,n − x1,n
Δyn = y2,n − y1,n
kn = Δyn / Δxn
λ = (xn − x1,n) / Δxn
yn = y1,n + λ · Δyn
y = yn · yscale + ymid
k = kn · (yscale / xscale)
where:
- y — interpolated value (-)
- k — slope dy/dx (-)
- λ — interpolation ratio (-)
- x1 — first interpolation point x-coordinate (-)
- y1 — first interpolation point value (-)
- x2 — second interpolation point x-coordinate (-)
- y2 — second interpolation point value (-)
- x — query point (-)
When to use this calculator
When to use this calculator:
- Estimate a value between two known data points using a linear segment.
- Check whether the query point is inside the interpolation segment or outside it.
- Calculate the segment slope between two measured or tabulated points.
- Evaluate the normalized position of the query point between the two interpolation points.
- Validate neighboring points for monotonicity and local slope consistency.
- Detect large local changes in slope when previous and next points are provided.
How to interpret the result
Interpolated value is defined as the value on the straight line between two endpoint values at the selected query point.
The result depends on endpoint values, endpoint spacing and query point position. Increasing the query point toward the second endpoint increases the interpolation ratio. Increasing the second endpoint value increases the interpolated value when the query point remains between the endpoints.
- Safe — the query point is inside the endpoint range, no monotonicity violation is detected, local linearity error is not greater than 0.2, normalized gradient jump is not greater than 2, and no invalid condition is triggered.
- Warning — the query point is outside the endpoint range, or neighboring slopes change sign, or local linearity error is greater than 0.2 and not greater than 0.5, or normalized gradient jump is greater than 2.
- Unsafe — local linearity error is greater than 0.5, or the query point is outside the endpoint range with |λ| greater than 2.
- Invalid — a required input is not finite, the endpoint x-coordinates are equal within tolerance, the interpolation ratio magnitude is greater than 5, the full series lengths differ, the full series x-values are not strictly increasing, or enforced monotonicity fails.
The result is used to evaluate the interpolated value, segment slope and query position validity for a local linear data segment.
Calculation example
Example:
A user has two tabulated values and wants to estimate the value at a query point located between them.
- x1 = 10
- y1 = 100
- x2 = 20
- y2 = 160
- x = 15
y = 130, k = 6, λ = 0.5
Assumptions and limitations
- The value between the two endpoints is represented by a straight line segment.
- The two endpoint x-coordinates must not be equal within the adaptive numerical tolerance.
- If a full data series is provided, x-values must be strictly increasing.
- Neighbor analysis is applied only when previous or next neighbor coordinates and values are provided.
- Advanced normalization changes the internal calculation scale and then converts the interpolated value and slope back to the original scale.
