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
Checked against published worked examples from: FAMU-FSU College of Engineering (L. van Dommelen, EML 3100 Thermodynamics course aids).
Details, formula, and sources
Scopey = 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).
Formula or tabley = y1 + (x - x1) x (y2 - y1) / (x2 - x1); slope = (y2 - y1) / (x2 - x1). The query is an extrapolation when x is outside [x1, x2].
Source and editionLinear interpolation between two known points - first-principles linear geometry; public domain.
Free accessPure arithmetic, public; the two reference points and the query x are user-supplied from the chart or table.
What governsEstimate. AHJ and licensed professional govern.
API field namesy1, x2, y2, x, y, slope
- Local linearity the value varies linearly between the two reference points; confirm against the source tablelinear interpolation