HOME

TheInfoList



OR:

Trilinear interpolation is a method of
multivariate interpolation In numerical analysis, multivariate interpolation or multidimensional interpolation is interpolation on ''multivariate functions'', having more than one variable or defined over a multi-dimensional domain. A common special case is bivariate inter ...
on a 3-dimensional
regular grid A regular grid is a tessellation of ''n''-dimensional Euclidean space by Congruence_(geometry), congruent parallelepiped#Parallelotope, parallelotopes (e.g. bricks). Its opposite is Unstructured grid, irregular grid. Grids of this type appear on ...
. It approximates the value of a function at an intermediate point (x, y, z) within the local axial rectangular prism linearly, using function data on the lattice points. Trilinear interpolation is frequently used in
numerical analysis Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic computation, symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of ...
,
data analysis Data analysis is the process of inspecting, Data cleansing, cleansing, Data transformation, transforming, and Data modeling, modeling data with the goal of discovering useful information, informing conclusions, and supporting decision-making. Da ...
, and
computer graphics Computer graphics deals with generating images and art with the aid of computers. Computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. ...
.


Related methods

Trilinear interpolation is the extension of
linear interpolation In mathematics, linear interpolation is a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points. Linear interpolation between two known points If the two known po ...
, which operates in spaces with
dimension In physics and mathematics, the dimension of a mathematical space (or object) is informally defined as the minimum number of coordinates needed to specify any point within it. Thus, a line has a dimension of one (1D) because only one coo ...
D = 1, and
bilinear interpolation In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., ''x'' and ''y'') using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be ge ...
, which operates with dimension D = 2, to dimension D = 3. These interpolation schemes all use polynomials of order 1, giving an accuracy of order 2, and it requires 2^D = 8 adjacent pre-defined values surrounding the interpolation point. There are several ways to arrive at trilinear interpolation, which is equivalent to 3-dimensional
tensor In mathematics, a tensor is an algebraic object that describes a multilinear relationship between sets of algebraic objects associated with a vector space. Tensors may map between different objects such as vectors, scalars, and even other ...
B-spline In numerical analysis, a B-spline (short for basis spline) is a type of Spline (mathematics), spline function designed to have minimal Support (mathematics), support (overlap) for a given Degree of a polynomial, degree, smoothness, and set of bre ...
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 In geometry, a tetrahedron (: tetrahedra or tetrahedrons), also known as a triangular pyramid, is a polyhedron composed of four triangular Face (geometry), faces, six straight Edge (geometry), edges, and four vertex (geometry), vertices. The tet ...
(3D
simplices In geometry, a simplex (plural: simplexes or simplices) is a generalization of the notion of a triangle or tetrahedron to arbitrary dimensions. The simplex is so-named because it represents the simplest possible polytope in any given dimension. ...
), then barycentric coordinates provide a straightforward procedure.


Formulation

On a periodic and cubic lattice, let x_\text, y_\text, and z_\text be the differences between each of x, y, z and the smaller coordinate related, that is: :\begin x_\text = \frac \\ y_\text = \frac \\ z_\text = \frac \end 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 one interpolates along x (imagine one is "pushing" the face of the cube defined by C_ to the opposing face, defined by C_), giving: : \begin c_ &= c_ (1 - x_\text) + c_ x_\text \\ c_ &= c_ (1 - x_\text) + c_ x_\text \\ c_ &= c_ (1 - x_\text) + c_ x_\text \\ c_ &= c_ (1 - x_\text) + c_ x_\text \end Where c_ means the function value of (x_0, y_0, z_0). Then one interpolates these values (along y, "pushing" from C_ to C_), giving: : \begin c_0 &= c_(1 - y_\text) + c_y_\text \\ c_1 &= c_(1 - y_\text) + c_y_\text \end Finally one interpolates these values along z (walking through a line): :c = c_0(1 - z_\text) + c_1z_\text . 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.


Algorithm visualization

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 c_, c_, c_, c_, c_, c_, c_, c_. Next, we perform linear interpolation between c_ and c_ to find c_, c_ and c_ to find c_, c_ and c_ to find c_, c_ and c_ to find c_. Now we do interpolation between c_ and c_ to find c_, c_ and c_ to find c_. Finally, we calculate the value c via linear interpolation of c_ and c_ In practice, a trilinear interpolation is identical to two
bilinear interpolation In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., ''x'' and ''y'') using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be ge ...
combined with a linear interpolation: :c \approx l\left( b(c_, c_, c_, c_),\, b(c_, c_, c_, c_)\right)


Alternative algorithm

An alternative way to write the solution to the interpolation problem is :f(x, y, z) \approx a_0 + a_1 x + a_2 y + a_3 z + a_4 x y + a_5 x z + a_6 y z + a_7 x y z where the coefficients are found by solving the linear system :\begin \begin 1 & x_0 & y_0 & z_0 & x_0 y_0 & x_0 z_0 & y_0 z_0 & x_0 y_0 z_0 \\ 1 & x_1 & y_0 & z_0 & x_1 y_0 & x_1 z_0 & y_0 z_0 & x_1 y_0 z_0 \\ 1 & x_0 & y_1 & z_0 & x_0 y_1 & x_0 z_0 & y_1 z_0 & x_0 y_1 z_0 \\ 1 & x_1 & y_1 & z_0 & x_1 y_1 & x_1 z_0 & y_1 z_0 & x_1 y_1 z_0 \\ 1 & x_0 & y_0 & z_1 & x_0 y_0 & x_0 z_1 & y_0 z_1 & x_0 y_0 z_1 \\ 1 & x_1 & y_0 & z_1 & x_1 y_0 & x_1 z_1 & y_0 z_1 & x_1 y_0 z_1 \\ 1 & x_0 & y_1 & z_1 & x_0 y_1 & x_0 z_1 & y_1 z_1 & x_0 y_1 z_1 \\ 1 & x_1 & y_1 & z_1 & x_1 y_1 & x_1 z_1 & y_1 z_1 & x_1 y_1 z_1 \end\begin a_0 \\ a_1 \\ a_2 \\ a_3 \\ a_4 \\ a_5 \\ a_6 \\ a_7 \end = \begin c_ \\ c_ \\ c_ \\ c_ \\ c_ \\ c_ \\ c_ \\ c_ \end, \end yielding the result :\begin a_0 = &\frac + \\ &\frac, \\ pt a_1 = &\frac + \\ &\frac, \\ pt a_2 = &\frac + \\ &\frac, \\ pt a_3 = &\frac + \\ &\frac, \\ pt a_4 = &\frac, \\ pt a_5 = &\frac, \\ pt a_6 = &\frac, \\ pt a_7 = &\frac. \end{align}


See also

*
Linear interpolation In mathematics, linear interpolation is a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points. Linear interpolation between two known points If the two known po ...
*
Bilinear interpolation In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., ''x'' and ''y'') using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be ge ...
*
Tricubic interpolation In the mathematical subfield numerical analysis, tricubic interpolation is a method for obtaining values at arbitrary points in Three-dimensional space, 3D space of a function defined on a regular grid. The approach involves approximating the fun ...
* Radial interpolation * Tetrahedral interpolation * Spherical linear interpolation


External links


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, 201

Multivariate interpolation Euclidean solid geometry