Interpolation & Splines

Estimate values between known data points. Learn linear interpolation, polynomial interpolation (Lagrange form, Newton divided differences, forward/backward differences), interpolation error, Runge's phenomenon, and cubic splines used in CAD, CNC paths and lookup tables.

Steam tables, calibration curves, look-up tables in engine ECUs, and smooth CAD curves all rely on interpolation between tabulated or measured points.

An analogy

Interpolation is like connecting the dots in a puzzle: straight lines between dots (linear) or a smooth pen stroke that bends naturally (splines).

Linear interpolation

The workhorse for tables (steam tables, datasheets). Accurate when data are closely spaced or nearly linear.

Polynomial interpolation

n + 1 points define a unique degree-n polynomial. Lagrange form is conceptually simple; Newton's divided-difference form allows adding points easily.

Runge's phenomenon

High-degree polynomials through equally spaced points oscillate wildly near the ends. Use Chebyshev nodes or, better, piecewise low-degree interpolation.

Splines

Cubic splines join cubic pieces with continuous first and second derivatives — smooth like a draftsman's flexible spline. Natural, clamped and not-a-knot end conditions. B-splines and NURBS underpin CAD.

Formulas

Worked example: Quadratic through three points

Given: (1, 1), (2, 8), (3, 27) from f = x³

Find: P(2.5).

Answer: 16 (exact 15.625, error 0.375)

Worked example: Steam table

Given: h = 2675.5 kJ/kg at 100 °C, 2706.0 at 120 °C

Find: h at 110 °C.

Answer: 2690.8 kJ/kg

Common mistakes

Applications

Key takeaways

Going further