<< interp3 cglab mesh2_delete >>

cglab >> cglab > interp2

interp2

a bilinear interplation.

Calling Sequence

vp = interp2(xp,yp,x,y,v)

Parameters

xp,yp
: are two real vectors of the same size.
x,y
: strictly increasing row vectors defining the interpolation grid.
v
: is a matrix 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 interp2 is a bilinear interpolation, it computes the weighted sum of the function values.

Examples

n = 8;
x = linspace(0,2*%pi,n); y = x;
z = 2*sin(x')*cos(y);
xx = linspace(0,2*%pi, 40);
[xp,yp] = ndgrid(xx,xx);
zp = interp2(xp,yp, x, y, z);
plot3d(xx, xx, zp, flag=[2 6 4])
[xg,yg] = ndgrid(x,x);
param3d1(xg,yg, list(z,-9*ones(1,n)), flag=[0 0])
xtitle("Bilinear interpolation of 2sin(x)sin(y)")
legends("interpolation points",-9,1)
show_window();

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


Report an issue
<< interp3 cglab mesh2_delete >>