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
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 ...
, 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
, to dimension
. These interpolation schemes all use polynomials of order 1, giving an accuracy of order 2, and it requires
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
,
, and
be the differences between each of
,
,
and the smaller coordinate related, that is:
:
where
indicates the lattice point below
, and
indicates the lattice point above
and similarly for
and
.
First we interpolate along
(imagine we are "pushing" the face of the cube defined by
to the opposing face, defined by
), giving:
:
Where
means the function value of
Then we interpolate these values (along
, "pushing" from
to
), giving:
:
Finally we interpolate these values along
(walking through a line):
:
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
, then along
, and finally along
, 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
,
,
,
,
,
,
,
.
Next, we perform linear interpolation between
and
to find
,
and
to find
,
and
to find
,
and
to find
.
Now we do interpolation between
and
to find
,
and
to find
. Finally, we calculate the value
via linear interpolation of
and
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:
:
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
*
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