c_natgridd(3NCARG)

πŸ’– c_natgridd β€” bestie edition πŸ’–

okay so this is the NCAR GRAPHICS page for c_natgridd(3NCARG), and honestly? she's that girl. it's the double precision C entry point for natural neighbor gridding. let's get into it πŸ¦‹


✨ NAME ✨

c_natgrids β€” primary double precision C entry for natural neighbor gridding

(yes bestie, the NAME section really does say c_natgrids. that's just what it says. i don't make the rules πŸ’…)


🧚 FUNCTION PROTOTYPE 🧚

double  *c_natgridd(int, double [], double [], double [],
                    int, int, double [], double [], int *);

🌸 SYNOPSIS 🌸

double *c_natgridd (npnts, x, y, z, numxout, numyout, xi, yi, ier);

πŸ‘‘ DESCRIPTION πŸ‘‘

here's the whole cast, no skips, no cuts ✨

  • npnts β€” the number of input data points. and it has to be npnts > 3. like, more than three. that's the vibe check and it is not optional 😀
  • x β€” an array holding the x coordinates of the input data points.
  • y β€” an array holding the y coordinates of the input data points.
  • z β€” an array holding the functional values of the input data points. so basically z[m] is the value of the input function at coordinate (x[m],y[m]), for 0 <= m < npnts. cute right?
  • numxout β€” the number of x values in the output grid.
  • numyout β€” the number of y values in the output grid.
  • xi β€” an array of dimension numxout containing the x coordinates of the output data grid. the values in xi must be increasing, but they do not need to be equally spaced. flexible queen πŸ’…
  • yi β€” an array of dimension numyout containing the y coordinates of the output data grid. the values in yi must be increasing, but they do not need to be equally spaced either. same energy, different axis ✨
  • ier β€” an error value. if *ier is 0, then no errors were detected, we're thriving πŸŽ€. if *ier is non-zero, then go read the man page for natgrid_errors for the details. that's where the lore lives.

πŸ”₯ USAGE πŸ”₯

okay so c_natgridd returns a pointer to a linear array of data that is the interpolated grid, stored in row-major order. let me set the scene:

if out is declared as

double *out;

and we set:

out = c_natgridd(numin, x, y, z, numxout, numyout, xo, yo, &ier);

then out[i*numyout+j] is the interpolated function value at coordinate point (xo[i],yo[j]) for 0 <= i < numxout and 0 <= j < numyout. 🫢

and here's the part where she's lowkey generous: the space for out is allocated internal to c_natgrids, and it is numxout*numyout double values in size. no cap. you don't gotta malloc that yourself. iconic behavior honestly πŸ’œ


🌈 ACCESS 🌈

to use c_natgridd, load the NCAR Graphics library ngmath. that's it. that's the whole step. periodt ✨


πŸŽ€ SEE ALSO πŸŽ€

go read these too, they're all in the same friend group:

  • natgrid
  • natgrid_params
  • c_nnseti
  • c_nngeti
  • c_nnsetrd
  • c_nngetrd
  • c_nnsetc
  • c_nngetc

also! complete documentation for Natgrid is available at URL

http://ngwww.ucar.edu/ngdoc/ng/ngmath/natgrid/nnhome.html

Copyright (C) 2000
University Corporation for Atmospheric Research

The use of this Software is governed by a License Agreement.
bestie. please. the use of this software is governed by a License Agreement. read it. i'm begging πŸ™ˆ

and that's the whole page, start to finish, nothing skipped, every flag and every word intact πŸ¦‹πŸ’–

this has been c_natgridd(3NCARG) from the UNIX manual pages, March 1997-1998 vintage β€” an absolute era, no notes, ate and left no crumbs πŸ‘‘βœ¨ bye bestie πŸŽ€