arvau

Wikipedia / Trilinear interpolation

Trilinear interpolation is a method of multivariate interpolation on a 3-dimensional regular grid within the local axial rectangular prism linearly, using function data on the lattice points. Trilinear interpolation is frequently used in numerical analysis, data analysis, and computer graphics.

Related methods

Trilinear interpolation is the extension of linear interpolation, which operates in spaces with dimension, and bilinear interpolation adjacent pre-defined values surrounding the interpolation point. There are several ways to arrive at trilinear interpolation, which 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.

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.

Formulation

. Take a similar approach for the other coordinates:

), giving:

), giving:

(walking through a line):

, produces the same value.

Algorithm visualization

.

.

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

Alternative algorithm

An alternative way to write the solution to the interpolation problem is

where the coefficients are found by solving the linear system

yielding the result

See also

  • pseudo-code from NASA, describes an iterative inverse trilinear interpolation (given the vertices and the value of C find Xd, Yd and Zd).

  • Paul Bourke, Interpolation methods, 1999. Contains a very clever and simple method to find trilinear interpolation that is based on binary logic and can be extended to any dimension (Tetralinear, Pentalinear, ...).

  • Kenwright, Free-Form Tetrahedron Deformation. International Symposium on Visual Computing. Springer International Publishing, 2015 https://link.springer.com/chapter/10.1007/978-3-319-27863-6_74.