Interpolation

Level UniversityDifficulty ★★★★★Concept⌖ Open in the map

What is it?

Building a function that passes through given data points. Linear interpolation (lerp) is everywhere in graphics and animation; polynomials of high degree oscillate wildly (Runge's phenomenon), so practice uses piecewise polynomials: splines.

Formulas

lerp⁡(a,b,t)=(1−t) a+t b,t∈[0,1]\operatorname{lerp}(a, b, t) = (1 - t)\,a + t\,b, \quad t \in [0, 1]
p(x)=∑i=0nyi∏j≠ix−xjxi−xjp(x) = \sum_{i=0}^{n} y_i \prod_{j \ne i}\frac{x - x_j}{x_i - x_j}
Lagrange form

Where it shows up in computing

  • Image processing and computer vision★★★★★fundamentalSignals, media and vision

    Resizing and rotating images samples between pixels with bilinear or bicubic interpolation.

  • Lighting and shading★★★★★frequentComputer graphics

    GPUs interpolate colours, normals and texture coordinates across each triangle (barycentric interpolation).

  • Bézier curves and splines★★★★★frequentComputer graphics

    De Casteljau's algorithm evaluates a Bézier curve by repeated linear interpolation.

  • Signal processing★★★★★frequentSignals, media and vision

    Resampling audio between rates interpolates between samples (ideally with a sinc kernel).

Where is it used?

Computing topics reachable from here, through the chain of ideas that leads to them:

This page has the essentials. A fuller treatment (intuition, formal definition, worked example) is on the way.

↑ ↓ to navigate · ↵ · Esc