ArticleslgStudy

mathematics

Trilinear interpolation

Trilinear interpolation is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Trilinear interpolation rather than just read about it. In short: Trilinear interpolation is a method of multivariate interpolation on a 3-dimensional regular grid. 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 — main illustration
Trilinear interpolation — illustration

Key takeaways

  • Trilinear interpolation belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Trilinear interpolation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Trilinear interpolation from memory before moving on to harder problems.

Reference excerpt

Trilinear interpolation is a method of multivariate interpolation on a 3-dimensional regular grid. 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, data analysis, and computer graphics.

Related methods 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. These interpolation schemes all use polynomials of order 1, giving an accuracy of order 2, and it requires 2D=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 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

On a periodic and cubic lattice, we want the value at x, y, z. In the general case, each coordinate (for example, x) is not exactly at a lattice point, but some distance between one lattice point x0 and the next, x1. Let xd be that fractional distance away from the lower lattice point: x−x0x1−x0. Take a similar approach for the other coordinates:

xd=x−x0x1−x0yd=y−y0y1−y0zd=z−z0z1−z0

First one interpolates along x (imagine one is "pushing" the face of the cube defined by C0jk to the opposing face, defined by C1jk), giving:

c00=c000(1−xd)+c100xdc01=c001(1−xd)+c101xdc10=c010(1−xd)+c110xdc11=c011(1−xd)+c111xd Where c000 means the function value of (x0,y0,z0). Then one interpolates these values (along y, "pushing" from Ci0k to Ci1k), giving:

c0=c00(1−yd)+c10ydc1=c01(1−yd)+c11yd Finally one interpolates these values along z (walking through a line):

c=c0(1−zd)+c1zd. This gives a predicted value for the point, which can also be written as follows:c=c000(1−xd)(1−yd)(1−zd)+c100xd(1−yd)(1−zd)+c010(1−xd)yd(1−zd)+c110xdyd(1−zd)+c001(1−xd)(1−yd)zd+c101xd(1−yd)zd+c011(1−xd)ydzd+c111xdydzd This makes it obvious that the predicted value via trilinear interpolation is independent of the order of the interpolation steps along the three axes: any other order, for instance along y, then along z, and finally along x, 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 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(c000,c010,c100,c110),b(c001,c011,c101,c111))

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

f(x,y,z)≈a0+a1x+a2y+a3z+a4xy+a5xz+a6yz+a7xyz where the coefficients are found by solving the linear system

[1x0y0z0x0y0x0z0y0z0x0y0z01x1y0z0x1y0x1z0y0z0x1y0z01x0y1z0x0y1x0z0y1z0x0y1z01x1y1z0x1y1x1z0y1z0x1y1z01x0y0z1x0y0x0z1y0z1x0y0z11x1y0z1x1y0x1z1y0z1x1y0z11x0y1z1x0y1x0z1y1z1x0y1z11x1y1z1x1y1x1z1y1z1x1y1z1][a0a1a2a3a4a5a6a7]=[c000c100c010c110c001c101c011c111], yielding the result

a0=−c000x1y1z1+c001x1y1z0+c010x1y0z1−c011x1y0z0(x0−x1)(y0−y1)(z0−z1)+c100x0y1z1−c101x0y1z0−c110x0y0z1+c111x0y0z0(x0−x1)(y0−y1)(z0−z1),a1=c000y1z1−c001y1z0−c010y0z1+c011y0z0(x0−x1)(y0−y1)(z0−z1)+−c100y1z1+c101y1z0+c110y0z1−c111y0z0(x0−x1)(y0−y1)(z0−z1),a2=c000x1z1−c001x1z0−c010x1z1+c011x1z0(x0−x1)(y0−y1)(z0−z1)+−c100x0z1+c101x0z0+c110x0z1−c111x0z0(x0−x1)(y0−y1)(z0−z1),a3=c000x1y1−c001x1y1−c010x1y0+c011x1y0(x0−x1)(y0−y1)(z0−z1)+−c100x0y1+c101x0y1+c110x0y0−c111x0y0(x0−x1)(y0−y1)(z0−z1),a4=−c000z1+c001z0+c010z1−c011z0+c100z1−c101z0−c110z1+c111z0(x0−x1)(y0−y1)(z0−z1),a5=−c000y1+c001y1+c010y0−c011y0+c100y1−c101y1−c110y0+c111y0(x0−x1)(y0−y1)(z0−z1),a6=−c000x1+c001x1+c010x1−c011x1+c100x0−c101x0−c110x0+c111x0(x0−x1)(y0−y1)(z0−z1),a7=c000−c001−c010+c011−c100+c101+c110−c111(x0−x1)(y0−y1)(z0−z1).

See also Linear interpolation Bilinear interpolation Tricubic 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, 2015 [1].

Illustrations

Trilinear interpolation: Trilinear interpolation as two bilinear interpolations followed by a linear interpolation
Trilinear interpolation as two bilinear interpolations followed by a linear interpolation
Trilinear interpolation: Eight corner points on a cube surrounding the interpolation point C
Eight corner points on a cube surrounding the interpolation point C
Trilinear interpolation: A geometric visualisation of trilinear interpolation. The product of the value at the desired point and the entire volume is equal to the sum of the products of the value at each corner and the partial volume diagonally opposite the corner.
A geometric visualisation of trilinear interpolation. The product of the value at the desired point and the entire volume is equal to the sum of the products of the value at each corner and the partial volume diagonally opposite the corner.

Worked examples

Example 1 — a first encounter with Trilinear interpolation

Start with the simplest possible case. Write down what Trilinear interpolation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Trilinear interpolation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Trilinear interpolation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Trilinear interpolation

In research
Trilinear interpolation appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Trilinear interpolation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Trilinear interpolation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Euclidean solid geometry, Multivariate interpolation, so understanding it makes those chapters shorter.
In everyday life
Look for Trilinear interpolation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Trilinear interpolation” →

How to study Trilinear interpolation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Trilinear interpolation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Trilinear interpolation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Trilinear interpolation in simple terms?

Trilinear interpolation is a method of multivariate interpolation on a 3-dimensional regular grid. 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.

Why does Trilinear interpolation matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Trilinear interpolation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Trilinear interpolation.

Tags

  • Euclidean solid geometry
  • Multivariate interpolation

Keep exploring