Interpolation in Two Dimensions

Three ways to extend values known at a few points of ℝ2 to the whole plane: barycentric weights inside a triangle, scattered data (nearest neighbor, inverse distance, triangulation), and grid data (image resampling with nearest, bilinear, bicubic).

Barycentric coordinates

Drag the colored vertices or the black point p. Color = a1·red + a2·green + a3·blue.

Scattered data

Click to add a sample (value from slider). Shift+click removes the nearest one.
value p 2

Grid data: image resampling

A tiny 24×24 image, zoomed and rotated. Every output pixel looks up a non-integer source position.
zoom rot