liveBook · Manning

Quadratic interpolation

As explained in Geometry for Programmers

Quadratic interpolation is the construction of a polynomial interpolation function of degree two from specified data points.

Quadratic interpolation constructs a degree-two polynomial through three specified values. For points at 0, 0.5, and 1, solve the three point-on-curve equations, then evaluate the resulting polynomial at any intermediate x. section 8.1.2

A reusable quadratic interpolant

For values z1, z2, and z3, use P2(z1, z2, z3, x) = ax² + bx + c, where a = 2z1 − 4z2 + 2z3, b = −3z1 + 4z2 − z3, and c = z1. Applying this along three y-oriented lines and interpolating those results along x produces a biquadratic surface. section 8.1.2

Use quadratic interpolation when:

  • Three values determine an unambiguous single-variable quadratic. section 8.5
  • A higher-dimensional surface can be built by repeating one-dimensional interpolation along each coordinate. section 8.1.2
  • A polynomial approximation is acceptable; exact cylindrical geometry requires rational splines such as NURBS. section 8.5

How Geometry for Programmers covers it

How deep it goes
Derives coefficients, gives a Python implementation, nests one-dimensional passes, and notes the constraint of predefined positions.
Examples
Uses points at 0, 0.5, and 1, SymPy coefficient solving, a P2 function, and a nine-value biquadratic surface.
What it assumes
Assumes familiarity with linear interpolation and polynomial graphs while extending the method from two-point lines to three-point parabolas.
What you can do after
Build it from scratch by solving three equations and implementing the resulting quadratic and nested surface functions.
How it connects
Connects polynomial interpolation with bilinear interpolation, biquadratic interpolation, rational splines, and NURBS.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.