<< dtn_insert_points CG-lab interp2 >>

CG-lab >> CG-lab > interp3

interp3

a trilinear interplation.

Calling Sequence

vp = interp3(xp,yp,zp,x,y,z,v)

Parameters

xp,yp,zp
: are two real vectors or matrices with the same size.
x,y,z
: strictly increasing row vectors defining the interpolation grid.
v
: is an hypermatrix with the values of the interpolated function at the grid points.
vp
: is a matrix containing the returned values of the interpolation.

Description

The function interp3 is a trilinear interpolation, it computes the weighted sum of the function values.

Examples

func =  "v=2*(x-0.5).*(y-0.5) + 4*(z-0.5)";
deff("v=f(x,y,z)",func);
n = 5; 
x = linspace(0,1,n); y=x; z=x;
[X,Y,Z] = ndgrid(x,y,z);
V = f(X,Y,Z);
// compute (and display) the linear interpolant on some slices
m = 10;
Xp = linspace(0,1,m); Yp=Xp; Zp=Xp;

Vp =  interp3(Xp,Yp,Zp, x, y, z, V);
V_exact = f(Xp,Yp,Zp);
         
norm(Vp -V_exact) < 10e-14

See Also

for more details see CGAL Manual.

This function uses the Interpolation package of CGAL, which is under QPL license. See License Terms

Authors

<< dtn_insert_points CG-lab interp2 >>