Trilinear interpolation
From Wikipedia, the free encyclopedia
Trilinear interpolation is a method of performing interpolation on a 3-dimensional tensor product grid (possibly with an arbitrary, non-overlapping grid points in each dimension, but i.e. not an arbitrarily triangularized finite element mesh) of discretely sampled data. It approximates the value of an intermediate point (x,y,z) within the local axial rectangular prism linearly, using data on the lattice points.
Trilinear interpolation is frequently used in numerical analysis, data analysis, and computer graphics.
Contents |
[edit] Properties, relation to linear interpolation and bilinear interpolation
- Trilinear interpolation operates in a parameter space with dimension D = 3 (bilinear: D = 2, linear: D = 1) of order n = 1, thus requiring (1 + n)D = 8 adjacent pre-defined values surrounding the interpolation point.
- Trilinear interpolation is equivalent to 3-dimensional tensor B-spline interpolation of order 1.
- The trilinear interpolation operator is a tensor product of 3 linear interpolation operators.
[edit] Example
On a periodic and cubic lattice with spacing 1, let
- xd,yd,zd
be the differences to the largest integer smaller than each of
- x,y,z,
that is:
First we interpolate along z, giving:
Then we interpolate these values (along y), giving:
- w1 = i1(1 − yd) + i2yd
- w2 = j1(1 − yd) + j2yd
Finally we interpolate these value along x:
- IV = w1(1 − xd) + w2xd.
This gives us a predicted value for the point.
The result of trilinear interpolation is independent of the order of the successive interpolation steps, that is, performing the linear interpolations in another order of dimensions, along x, along y, then along z, produces an identical expression for the predicted value. This also follows immediately from the property of tensor products being commutative.