Scilab Function
Last update : 3/10/2006

cgal_interp3 - a trilinear interplation.

Calling Sequence

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

Parameters

Description

The function cgal_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 =  cgal_interp3(Xp,Yp,Zp, x, y, z, V);
V_exact = f(Xp,Yp,Zp);
		 
norm(Vp -V_exact) < 10e-14
 
  

See Also

linear_interpn ,   cgal_interp2 ,  

for more details see CGAL Manual.

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

Authors

Naceur MESKINI.