HOME

TheInfoList



OR:

Trilinear interpolation is a method of
multivariate interpolation In numerical analysis, multivariate interpolation is interpolation on functions of more than one variable; when the variates are spatial coordinates, it is also known as spatial interpolation. The function to be interpolated is known at given poi ...
on a
3-dimensional Three-dimensional space (also: 3D space, 3-space or, rarely, tri-dimensional space) is a geometric setting in which three values (called ''parameters'') are required to determine the position of an element (i.e., point). This is the informal ...
regular grid A regular grid is a tessellation of ''n''-dimensional Euclidean space by congruent parallelotopes (e.g. bricks). Its opposite is irregular grid. Grids of this type appear on graph paper and may be used in finite element analysis, finite volume ...
. It approximates the value of a function at an intermediate point (x, y, z) within the local axial rectangular
prism Prism usually refers to: * Prism (optics), a transparent optical component with flat surfaces that refract light * Prism (geometry), a kind of polyhedron Prism may also refer to: Science and mathematics * Prism (geology), a type of sedimentary ...
linearly, using function data on the lattice points. For an arbitrary, unstructured mesh (as used in
finite element The finite element method (FEM) is a popular method for numerically solving differential equations arising in engineering and mathematical modeling. Typical problem areas of interest include the traditional fields of structural analysis, heat t ...
analysis), other methods of interpolation must be used; if all the mesh elements are
tetrahedra In geometry, a tetrahedron (plural: tetrahedra or tetrahedrons), also known as a triangular pyramid, is a polyhedron composed of four triangular faces, six straight edges, and four vertex corners. The tetrahedron is the simplest of all the o ...
(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 In mathematics, an affine space is a geometric structure that generalizes some of the properties of Euclidean spaces in such a way that these are independent of the concepts of distance and measure of angles, keeping only the properties related ...
provide a straightforward procedure. 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 a process of inspecting, cleansing, transforming, and modeling data with the goal of discovering useful information, informing conclusions, and supporting decision-making. Data analysis has multiple facets and approaches, enco ...
, and
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
.


Compared to linear and bilinear interpolation

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 poin ...
, which operates in spaces with
dimension In physics and mathematics, the dimension of a Space (mathematics), mathematical space (or object) is informally defined as the minimum number of coordinates needed to specify any Point (geometry), point within it. Thus, a Line (geometry), lin ...
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 related to a vector space. Tensors may map between different objects such as vectors, scalars, and even other tenso ...
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_\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 we interpolate along x (imagine we are "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 we interpolate 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 we interpolate 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. 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 poin ...
*
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 3D space of a function defined on a regular grid. The approach involves approximating the function locally by an expre ...
*
Radial interpolation Radial is a geometric term of location which may refer to: Mathematics and Direction * Vector (geometric), a line * Radius, adjective form of * Radial distance, a directional coordinate in a polar coordinate system * Radial set * A bearing f ...
* Tetrahedral 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