Linear Interpolation
Read a value between two known points off a chart or table.
Example
You enter
- Point 1 y 10
- Point 2 x 10
- Point 2 y 30
- Query x 4
You get
- Interpolated y 18
- Slope 2
Details, formula, and sources
y = y1 + (x - x1) x (y2 - y1) / (x2 - x1), with the slope and an extrapolation flag when the query falls outside the two points (first-principles linear interpolation for derating, pump-curve, steam, psychrometric, and calibration tables).
y = y1 + (x - x1) x (y2 - y1) / (x2 - x1); slope = (y2 - y1) / (x2 - x1). The query is an extrapolation when x is outside [x1, x2].
Linear interpolation between two known points - first-principles linear geometry; public domain.
Pure arithmetic, public; the two reference points and the query x are user-supplied from the chart or table.
Estimate. AHJ and licensed professional govern.
Field names used by the API: y1, x2, y2, x, y, slope
- Local linearity the value varies linearly between the two reference points; confirm against the source tablelinear interpolation