c_ftsurf(3NCARG)
π c_ftsurf β 2D tension spline interpolation of rectangular data π
okay bestie, so this is c_ftsurf, and it lives in the NCAR GRAPHICS manual (section 3NCARG, for the record π). it does 2D tension spline interpolation of rectangular data and honestly? it eats. let's get into it π
β¨ FUNCTION PROTOTYPE β¨
float *c_ftsurf (int, int, float *, float *, float *,
int, int, float *, float *, int *);
π¦ SYNOPSIS π¦
float *c_ftsurf (mi, ni, xi, yi, zi, mo, no, xo, yo, ier);
πΈ DESCRIPTION πΈ
here's the rundown of every single thing you're handing over, no skipping, i promise:
miβ the number of grid lines in the X direction. (gotta bemi > 1)niβ the number of grid lines in the Y direction. (gotta beni > 1)xiβ pointer to an array holding m X coordinates for the grid lines in the X direction.yiβ pointer to an array holding n Y coordinates for the grid lines in the Y direction.ziβ pointer tom x nfloats, aka the functional values at the grid points defined byxiandyi.moβ how many output values you want in the X direction.noβ how many output values you want in the Y direction.ierβ the value*ieris the error flag, and it's giving:= 0β no error. we love a clean run π«Ά= 1β ifnis less than 2 ormis less than 2.= 2β if X or Y values are not strictly increasing.
π₯ RETURN VALUE π₯
c_ftsurf returns a pointer to an array containing mo x no floats β those are the interpolated values on the grid specified by the arrays xo and yo. iconic behavior, truly.
π USAGE π
this procedure calculates an interpolatory surface passing through a rectangular grid of function values. the surface it computes is a tensor product of splines under tension. no cap, that's the whole vibe.
here's the order of operations bestie: you call c_ftsurf after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetc, c_ftsetfa. the control parameters that apply to c_ftsurf are: sig, zx1, zxm, zy1, zyn, z11, zm1, z1n, zmn, df1, df2, df3, df4, df5, df6, df7, df8.
- the value for the parameter
sigspecifies 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 is1.(the default). so like,sigis literally the main character here π zx1is an array containingnX-partial derivatives of the function along the linexi[0]β that is,zx1[j]is the X-partial derivative at point(x[0],y[j])forj=0,n-1. this parameter may be defaulted by setting the value fordf1appropriately. the default is to computezx1internally. values forzx1can be set using the procedurec_ftsetfa.zxmis an array containingnX-partial derivatives of the function along the linexi[m-1]β that is,zxm[j]is the X-partial derivative at point(xi[m-1],yi[j])forj=0,n-1. this parameter may be defaulted by setting the value fordf2appropriately. the default is to computezx2internally. values forzxmcan be set using the procedurec_ftsetfa.zy1is an array containingmY-partial derivatives of the function along the lineyi[0]β that is,zy1[j]is the Y-partial derivative at point(x[i],y[0])fori=0,m-1. this parameter may be defaulted by setting the value fordf3appropriately. the default is to computezy1internally. values forzy1can be set using the procedurec_ftsetfa.zynis an array containingmY-partial derivatives of the function along the lineyi[n-1]β that is,zyn[j]is the Y-partial derivative at point(x[i],y[n-1])fori=0,m-1. this parameter may be defaulted by setting the value fordf4appropriately. the default is to computezyninternally. values forzyncan be set using the procedurec_ftsetfa.z11,zm1,z1n,zmnspecify X-Y-partial derivatives of the function at the four corners(xi[0],yi[0]),(xi[m-1],yi[0]),(xi[0],yi[n-1]),(xi[m-1],yi[n-1]). these parameters may be defaulted by setting the values fordf5,df6,df7,df8, appropriately. the default is to computez11,zm1,z1n,zmninternally.
π ACCESS π
to use c_ftsurf, load the NCAR Graphics library ngmath. that's it, that's the whole step π¦
π SEE ALSO π
fitgrid_paramsc_ftsetic_ftsetrc_ftsetc
complete documentation for Fitgrid is available at URL http://ngwww.ucar.edu/ngdoc/ng/ngmath/fitgrid/fithome.html β go read it, iykyk π
β COPYRIGHT β
Copyright (C) 2000 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
and that's the page, bestie π«Ά this one's from the UNIX manual, dated March 1998, filed under c_ftsurf(3NCARG). go forth and interpolate responsibly, mwah πβ¨π
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms