Jump to content

Bilinear interpolation

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Berland (talk | contribs) at 08:08, 1 October 2007 (rm see also-link to Microsphere projection (has been deleted)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables on a regular grid. The key idea is to perform linear interpolation first in one direction, and then in the other direction.

The four red dots show the data points and the green dot is the point at which we want to interpolate.
Example of bilinear interpolation on the unit square with the z-values 0, 1, 1 and 0.5 as indicated. Interpolated values in between represented by colour.

Suppose that we want to find the value of the unknown function f at the point P = (x, y). It is assumed that we know the value of f at the four points Q11 = (x1y1), Q12 = (x1y2), Q21 = (x2y1), and Q22 = (x2y2).

We first do linear interpolation in the x-direction. This yields

 

We proceed by interpolating in the y-direction.

This gives us the desired estimate of f(x, y).

If we choose a coordinate system in which the four points where f is known are (0, 0), (0, 1), (1, 0), and (1, 1), then the interpolation formula simplifies to

Or equivalently, in matrix operations:

Contrary to what the name suggests, the interpolant is not linear. Instead, it is of the form

so it is a product of two linear functions. Alternatively, the interpolant can be written as

where

.

In both cases, the number of constants (four) correspond to the number of data points where f is given. The interpolant is linear along lines parallel to either the or the direction, equivalently if or is set constant. Along any other straight line, the interpolant is quadratic.

The result of bilinear interpolation is independent of the order of interpolation. If we had first performed the linear interpolation in the y-direction and then in the x-direction, the resulting approximation would be the same.

The obvious extension of bilinear interpolation to three dimensions is called trilinear interpolation.

See also