HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Compute coefficients for trilinear interpolation. More...
#include <mathfunctions.h>
Go to the source code of this file.
Functions | |
void | TrilinearInterpCoeffs (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double x, double y, double z, double *coeffs) |
Compute coefficients for trilinear interpolation.
Definition in file TrilinearInterpolation.c.
void TrilinearInterpCoeffs | ( | double | xmin, |
double | xmax, | ||
double | ymin, | ||
double | ymax, | ||
double | zmin, | ||
double | zmax, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | coeffs | ||
) |
This function computes the coefficients for a trilinear interpolation at a given point (x,y,z) inside a cube defined by [xmin,xmax] X [ymin,ymax] X [zmin,zmax]. The coefficients are stored in an array of size 8 with each element corresponding to a corner of the cube in the following order:
coeffs[0] => xmin,ymin,zmin
coeffs[1] => xmax,ymin,zmin
coeffs[2] => xmin,ymax,zmin
coeffs[3] => xmax,ymax,zmin
coeffs[4] => xmin,ymin,zmax
coeffs[5] => xmax,ymin,zmax
coeffs[6] => xmin,ymax,zmax
coeffs[7] => xmax,ymax,zmax
xmin | x-coordinate of the lower-end |
xmax | x-coordinate of the higher-end |
ymin | y-coordinate of the lower-end |
ymax | y-coordinate of the higher-end |
zmin | z-coordinate of the lower-end |
zmax | z-coordinate of the higher-end |
x | x-coordinate of the point to interpolate at |
y | y-coordinate of the point to interpolate at |
z | z-coordinate of the point to interpolate at |
coeffs | array of size 8 (pre-allocated) to store the coefficients in |
Definition at line 22 of file TrilinearInterpolation.c.