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 expression of the form [math]\displaystyle{ f(x,y,z)=\sum_{i=0}^3 \sum_{j=0}^3 \sum_{k=0}^3 a_{ijk} x^i y^j z^k. }[/math]
This form has 64 coefficients [math]\displaystyle{ a_{ijk} }[/math]; requiring the function to have a given value or given directional derivative at a point places one linear constraint on the 64 coefficients.
The term tricubic interpolation is used in more than one context; some experiments measure both the value of a function and its spatial derivatives, and it is desirable to interpolate preserving the values and the measured derivatives at the grid points. Those provide 32 constraints on the coefficients, and another 32 constraints can be provided by requiring smoothness of higher derivatives.[1]
In other contexts, we can obtain the 64 coefficients by considering a 3×3×3 grid of small cubes surrounding the cube inside which we evaluate the function, and fitting the function at the 64 points on the corners of this grid.
The cubic interpolation article indicates that the method is equivalent to a sequential application of one-dimensional cubic interpolators. Let [math]\displaystyle{ \mathrm{CINT}_x(a_{-1}, a_0, a_1, a_2) }[/math] be the value of a monovariable cubic polynomial (e.g. constrained by values, [math]\displaystyle{ a_{-1} }[/math], [math]\displaystyle{ a_{0} }[/math], [math]\displaystyle{ a_{1} }[/math], [math]\displaystyle{ a_{2} }[/math] from consecutive grid points) evaluated at [math]\displaystyle{ x }[/math]. In many useful cases, these cubic polynomials have the form [math]\displaystyle{ \mathrm{CINT}_x(u_{-1}, u_0, u_1, u_2) = \mathbf{v}_x \cdot \left( u_{-1}, u_0, u_1, u_2 \right) }[/math] for some vector [math]\displaystyle{ \mathbf{v}_x }[/math] which is a function of [math]\displaystyle{ x }[/math] alone. The tricubic interpolator is equivalent to:
[math]\displaystyle{ \begin{align} s(i,j,k) & {} = \text{The value at grid point } (i,j,k)\\ t(i,j,z) & {} = \mathrm{CINT}_z\left( s(i,j,-1), s(i,j,0), s(i,j,1), s(i,j,2)\right) \\ u(i,y,z) & {} = \mathrm{CINT}_y\left( t(i,-1,z), t(i,0,z), t(i,1,z), t(i,2,z)\right) \\ f(x,y,z) & {} = \mathrm{CINT}_x\left( u(-1,y,z), u(0,y,z), u(1,y,z), u(2,y,z)\right) \end{align} }[/math] where [math]\displaystyle{ i,j,k\in\{-1,0,1,2\} }[/math] and [math]\displaystyle{ x,y,z\in[0,1] }[/math].
At first glance, it might seem more convenient to use the 21 calls to [math]\displaystyle{ \mathrm{CINT} }[/math] described above instead of the [math]\displaystyle{ {64 \times 64} }[/math] matrix described in Lekien and Marsden.[1] However, a proper implementation using a sparse format for the matrix (that is fairly sparse) makes the latter more efficient. This aspect is even much more pronounced when interpolation is needed at several locations inside the same cube. In this case, the [math]\displaystyle{ {64 \times 64} }[/math] matrix is used once to compute the interpolation coefficients for the entire cube. The coefficients are then stored and used for interpolation at any location inside the cube. In comparison, sequential use of one-dimensional integrators [math]\displaystyle{ \mathrm{CINT}_x }[/math] performs extremely poorly for repeated interpolations because each computational step must be repeated for each new location.
See also
- Cubic interpolation
- Bicubic interpolation
- Trilinear interpolation
References
- ↑ 1.0 1.1 Lekien, F.; Marsden, J. (2005-05-21). "Tricubic interpolation in three dimensions" (in en). Journal of Numerical Methods in Engineering 63 (3): 455–471. doi:10.1002/nme.1296. ISSN 0029-5981. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.89.7835.
External links
- Java/C++ implementation of tricubic interpolation
- C++ implementation of tricubic interpolation
- Python implementation
- NumPy implementation
- [1] einspline library
Original source: https://en.wikipedia.org/wiki/Tricubic interpolation.
Read more |