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 be mi > 1)
  • ni β€” the number of grid lines in the Y direction. (gotta be ni > 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 to m x n floats, aka the functional values at the grid points defined by xi and yi.
  • 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 *ier is the error flag, and it's giving:
    • = 0 β€” no error. we love a clean run 🫢
    • = 1 β€” if n is less than 2 or m is 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 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). so like, sig is literally the main character here πŸŽ€
  • zx1 is an array containing n 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,n-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 c_ftsetfa.
  • zxm is an array containing n X-partial derivatives of the function along the line xi[m-1] β€” that is, zxm[j] is the X-partial derivative at point (xi[m-1],yi[j]) for j=0,n-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 c_ftsetfa.
  • 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,m-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 c_ftsetfa.
  • zyn is an array containing m Y-partial derivatives of the function along the line yi[n-1] β€” that is, zyn[j] is the Y-partial derivative at point (x[i],y[n-1]) for i=0,m-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 c_ftsetfa.
  • z11, zm1, z1n, zmn specify 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 for df5, df6, df7, df8, appropriately. the default is to compute z11, zm1, z1n, zmn internally.

🌈 ACCESS 🌈

to use c_ftsurf, load the NCAR Graphics library ngmath. that's it, that's the whole step πŸ¦‹

πŸ’œ SEE ALSO πŸ’œ

  • fitgrid_params
  • c_ftseti
  • c_ftsetr
  • c_ftsetc

complete documentation for Fitgrid is available at URL http://ngwww.ucar.edu/ngdoc/ng/ngmath/fitgrid/fithome.html β€” go read it, iykyk πŸ’…

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 πŸ’–βœ¨πŸŽ€