Kalpana Kalpana (Editor)

Trilinear interpolation

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Trilinear interpolation

Trilinear interpolation is a method of multivariate interpolation on a 3-dimensional regular grid. It approximates the value of an intermediate point ( x , y , z ) within the local axial rectangular prism linearly, using data on the lattice points. For an arbitrary, unstructured mesh (as used in finite element analysis), other methods of interpolation must be used; if all the mesh elements are tetrahedra (3D simplices), then barycentric coordinates provide a straightforward procedure.

Contents

Trilinear interpolation is frequently used in numerical analysis, data analysis, and computer graphics.

Compared to linear and bilinear interpolation

Trilinear interpolation is the extension of linear interpolation, which operates in spaces with dimension D = 1 , and bilinear interpolation, which operates with dimension D = 2 , to dimension D = 3 . The order of accuracy is 1 for all these interpolation schemes, and it requires ( 1 + n ) D = 8 adjacent pre-defined values surrounding the interpolation point. There are several ways to arrive at trilinear interpolation, it is equivalent to 3-dimensional tensor B-spline interpolation of order 1, and the trilinear interpolation operator is also a tensor product of 3 linear interpolation operators.

Method

On a periodic and cubic lattice, let x d , y d , and z d be the differences between each of x , y , z and the smaller coordinate related, that is:

  x d = ( x x 0 ) / ( x 1 x 0 )   y d = ( y y 0 ) / ( y 1 y 0 )   z d = ( z z 0 ) / ( z 1 z 0 )

where x 0 indicates the lattice point below x , and x 1 indicates the lattice point above x and similarly for y 0 , y 1 , z 0 and z 1 .

First we interpolate along x (imagine we are pushing the front face of the cube to the back), giving:

  c 00 = V [ x 0 , y 0 , z 0 ] ( 1 x d ) + V [ x 1 , y 0 , z 0 ] x d   c 01 = V [ x 0 , y 0 , z 1 ] ( 1 x d ) + V [ x 1 , y 0 , z 1 ] x d   c 10 = V [ x 0 , y 1 , z 0 ] ( 1 x d ) + V [ x 1 , y 1 , z 0 ] x d   c 11 = V [ x 0 , y 1 , z 1 ] ( 1 x d ) + V [ x 1 , y 1 , z 1 ] x d

Where V [ x 0 , y 0 , z 0 ] means the function value of ( x 0 , y 0 , z 0 ) . Then we interpolate these values (along y , as we were pushing the top edge to the bottom), giving:

  c 0 = c 00 ( 1 y d ) + c 10 y d   c 1 = c 01 ( 1 y d ) + c 11 y d

Finally we interpolate these values along z (walking through a line):

  c = c 0 ( 1 z d ) + c 1 z d .

This gives us a predicted value for the point.

The result of trilinear interpolation is independent of the order of the interpolation steps along the three axes: any other order, for instance along x , then along y , and finally along z , produces the same value.

The above operations can be visualized as follows: First we find the eight corners of a cube that surround our point of interest. These corners have the values C000, C100, C010, C110, C001, C101, C011, C111.

Next, we perform linear interpolation between C000 and C100 to find C00, C001 and C101 to find C01, C011 and C111 to find C11, C010 and C110 to find C10.

Now we do interpolation between C00 and C10 to find C0, C01 and C11 to find C1. Finally, we calculate the value C via linear interpolation of C0 and C1

In practice, a trilinear interpolation is identical to two bilinear interpolation combined with a linear interpolation:

C   l ( b ( C 000 , C 010 , C 100 , C 110 ) , b ( C 001 , C 011 , C 101 , C 111 ) )

References

Trilinear interpolation Wikipedia