DOC

How calculators work

Linear Interpolation and the Numbers Between Measurements

Linear interpolation estimates a value between two measured points by assuming a straight local change. Learn the formula, units, examples, checks, and its hard limits.

Measurements rarely arrive at the exact time, voltage, depth, or concentration someone wants. Linear interpolation fills that gap with a deliberately modest claim: between two known points, treat the relationship as a straight segment. It is an estimate between anchors—not permission to invent a trend beyond them.

A surveyor views two measuring posts joined by a taut line with a marker between them
The estimate belongs on the straight segment joining two measured endpoints.
Two points: (x₀,y₀) and (x₁,y₁), with x₁ ≠ x₀y(x) = y₀ + (x − x₀)(y₁ − y₀)/(x₁ − x₀)

The result is defined as interpolation only when the target x lies between the two x-values.

A fraction of the distance becomes a fraction of the change

The cleanest form introduces a dimensionless position:

Positiont = (x − x₀)/(x₁ − x₀)
Weighted estimatey = (1 − t)y₀ + ty₁
Interpolation range0 ≤ t ≤ 1
Outside the ranget < 0 or t > 1 = extrapolation
x₀, x₁, x

Independent-variable coordinates in one common unit: hours, volts, metres, or another compatible unit.

y₀, y₁, y

Measured values in one common output unit: °C, kPa, dollars, and so on.

t

Fractional position with no unit. The weights 1 − t and t add to one.

The dimensional check catches mixed-unit errors. The slope (y₁ − y₀)/(x₁ − x₀) has units of y per x. Multiplying by x − x₀ restores y units, so it can be added to y₀. At x = x₀, the answer must be y₀; at x = x₁, it must be y₁.

A child and older engineer balance a beam between a small teal weight and a larger terracotta weight
The estimate is a weighted blend. Nearer endpoints get more weight; the two weights always sum to one.

Worked example 1: a temperature between observations

At 09:00 the recorded temperature is 20 °C; at 13:00 it is 40 °C. Estimate 10:30, explicitly assuming linear change over this four-hour window.

Fraction along the intervalt = (10.5 − 9)/(13 − 9) = 1.5/4 = 0.375
Estimatey = 20 + 0.375(40 − 20) = 27.5 °C
Weight check0.625(20) + 0.375(40) = 27.5 °C
Range check20 < 27.5 < 40

The answer is a straight-line estimate, not evidence that the temperature rose steadily every minute. A passing cloud, a heater cycle, or an unobserved front can make the actual curve bend.

Worked example 2: a local calibration lookup

Two calibration points say 1.0 V corresponds to 0 kPa and 5.0 V corresponds to 200 kPa. For 3.2 V:

Fractiont = (3.2 − 1.0)/(5.0 − 1.0) = 2.2/4.0 = 0.55
Pressurep = 0 + 0.55(200 − 0) = 110 kPa
Slope check200 kPa / 4.0 V = 50 kPa/V
Forward check0 + 2.2 V × 50 kPa/V = 110 kPa

NIST describes calibration as a relationship between known input and instrument response; a linear approximation is valid only over a supported range. See NIST’s calibration overview and linearity guidance.

What the straight line assumes

Inside the bracket

The target lies between measured x-values. NIST’s [interpolation reference](https://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/interpol.htm) distinguishes this from extrapolation.

Locally straight enough

Equal input steps should produce approximately equal output steps in the chosen interval.

Continuous quantity

A switch state, phase boundary, eligibility rule, or jump discontinuity cannot be made meaningful by drawing a line through it.

Known uncertainty

Endpoint error, rounding, and calibration uncertainty carry into the interpolated result.

A person lays a straight ruler bridge across two cliffs while a curved river bends far below
A straight segment is an explicit local model. It is useful between anchors, but it cannot promise to follow a curved or discontinuous process.

Common errors

ErrorRepair
Use two readings with the same x-valueThe denominator is zero; investigate repeated-measurement variation instead.
Mix minutes and hours, or mV and VConvert x-values to one unit before subtracting.
Call an outside value interpolationName it extrapolation and justify a model beyond the data.
Assume two points prove linearityThey always determine a line; use physics or more data to support it.
Report extra decimal placesRound to the evidence and propagate stated measurement uncertainty.

Linear interpolation is deliberately local. It is excellent for a transparent estimate inside a defended interval; it should be replaced by a measured curve, a piecewise model, or a physical model when curvature, thresholds, saturation, or discontinuities matter. USGS likewise notes that interpolation rules depend on domain coverage and continuous behavior in its methods reference.