ftsurf calculates an interpolatory surface passing through a rectangular grid of function values. The surface computed is a tensor product of splines under tension. ftsurf is in the Fitgrid package -- a package containing 1D and 2D interpolators using cubic splines under tension.
function ftsurf( xi[*] : float, yi[*] : float, zi[*][*] : float, xo[*] : float, yo[*] : float )
ftsurf does not recognize missing values.
Control parameters that apply to ftsurf are: sig, zx1, zxm, zy1, zyn, z11, zm1, z1n, zmn, df1, df2, df3, df4, df5, df6, df7, df8.
The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 50) result in nearly a polygonal line. A typical value is 1. (the default).
zx1 is an array containing mi X-partial derivatives of the function along the line xi[0], that is zx1[j] is the X-partial derivative at point (x[0],y[j]) for j=0,ni-1. This parameter may be defaulted by setting the value for df1 appropriately. The default is to compute zx1 internally. Values for zx1 can be set using the procedure ftsetp.
zxm is an array containing n X-partial derivatives of the function along the line xi[mi-1], that is zxm[j] is the X-partial derivative at point (xi[mi-1],yi[j]) for j=0,ni-1. This parameter may be defaulted by setting the value for df2 appropriately. The default is to compute zx2 internally. Values for zxm can be set using the procedure ftsetp.
zy1 is an array containing m Y-partial derivatives of the function along the line yi[0], that is zy1[j] is the Y-partial derivative at point (x[i],y[0]) for i=0,mi-1. This parameter may be defaulted by setting the value for df3 appropriately. The default is to compute zy1 internally. Values for zy1 can be set using the procedure ftsetp.
zyn is an array containing m Y-partial derivatives of the function along the line yi[ni-1], that is zyn[j] is the Y-partial derivative at point (x[i],y[ni-1]) for i=0,mi-1. This parameter may be defaulted by setting the value for df4 appropriately. The default is to compute zyn internally. Values for zyn can be set using the procedure ftsetp.
z11, zm1, z1n, zmn specify X-Y-partial derivatives of the function at the four corners (xi[0],yi[0]), (xi[mi-1],yi[0]), (xi[0],yi[ni-1]), (xi[mi-1],yi[ni-1]), These parameters may be defaulted by setting the values for df5, df6, df7, df8, appropriately. The default is to compute z11, zm1, z1n, zmn internally.
You can extrapolate values with ftsurv (that is calculate interpolated values for coordinates outside of the scope of the input grid), but these values are, in general, unreliable.
begin nxi = 11 nyi = 17 xi = fspan(0.,1.,nxi) yi = fspan(0.,1.,nyi) zi = new((/nxi,nyi/),float) do i=0,nxi-1 do j=0,nyi-1 zi(i,j) = 0.5 + 0.25*sin(-7.*xi(i)) + 0.25*cos(5.*yi(j)) end do end do nxo = 31 nyo = 21 xo = fspan(0.,1.,nxo) yo = fspan(0.,1.,nyo) zo = ftsurf(xi,yi,zi,xo,yo) end
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?