c_shgrid(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

c_shgrid πŸ’– (that's the NCAR Graphics manual, bestie, section 3NCARG)

okay so. sit down. hydrate. because we're about to talk about c_shgrid and she is that girl. this is the NCAR Graphics page, and it's literally about interpolating random data in 3-space using a modified Shepard's algorithm. no cap. let's get into it ✨


✨ NAME ✨

c_shgrid β€” interpolate random data in 3-space using a modified Shepard's algorithm πŸ¦‹


πŸŽ€ FUNCTION PROTOTYPE πŸŽ€

float *c_shgrid(int, float [], float [], float [], float [],
                int, int, int, float [], float [], float [], int*);

🌸 SYNOPSIS 🌸

float *c_shgrid (n, x[], y[], z[], f[], nxo, nyo, nzo,
                 xo[], yo[], zo[], ier);

πŸ’… DESCRIPTION πŸ’…

like, here's the whole cast of characters, one by one:

  • n β€” (integer, input) the number of input data points, and she's gotta be n > 9. no tiny crews allowed, periodt.
  • xi β€” (float, input) an array dimensioned for n holding the X coordinate values for the input function.
  • yi β€” (float, input) an array dimensioned for n holding the Y coordinate values for the input function.
  • zi β€” (float, input) an array dimensioned for n holding the Z coordinate values for the input function.
  • f β€” (float, input) an array with the functional values of the input function β€” so f[k] is the functional value at (xi[k], yi[k], zi[k]) for k=0,n-1. yes bestie, that's the whole run of them πŸ’œ
  • nxo β€” (integer, input) how many X coordinate values we're calculating for the output grid.
  • nyo β€” (integer, input) how many Y coordinate values we're calculating for the output grid.
  • nzo β€” the number of Z coordinate values to be calculated for the output grid.
  • xo β€” (float, input) an array dimensioned for nxo containing the X coordinates of the output grid.
  • yo β€” (float, output) an array dimensioned for nyo containing the Y coordinates of the output grid.
  • zo β€” (float, output) an array dimensioned for nzo containing the Z coordinates of the output grid.
  • ier β€” (pointer to integer, output) the error return value, the vibe check if you will. if *ier comes back as 0, then no errors were detected, we ate. if *ier is non-zero, then go look at the error list in the error table for the details πŸ‘€

πŸ”₯ USAGE πŸ”₯

so you call c_shgrid to interpolate randomly spaced data in 3-space. she uses a modified Shepard's algorithm to construct an interpolatory surface. iconic behavior honestly.

c_shgrid returns a pointer to a linear array of data β€” that's your interpolation grid, stored in row-major order. and the way that works is, if out is declared as

float *out;

and we set:

out = c_shgrid(n, x, y, z, f, nxo, nyo, nzo, xo, yo, zo, ier);

then out[nz*ny*i + nz*j + k] is the approximation function value at coordinate point (xo[i], yo[j], zo[k]) for 0 <= i < nx, 0 <= j < ny, and 0 <= k < nz. the space for out is allocated internally to c_shgrid and is nx*ny*nz floats in size. she handles the allocation herself, main character energy fr fr 🫢


🌈 ACCESS 🌈

to use c_shgrid, load the NCAR Graphics library ngmath. that's it, that's the whole gatekeeping situation.


πŸ‘‘ SEE ALSO πŸ‘‘

  • shgrid_params
  • c_shseti
  • c_shgeti
  • c_shgetnp

and if you want the complete documentation for Shgrid, it's available at this URL, bookmark it bestie:

http://ngwww.ucar.edu/ngdoc/ng/ngmath/shgrid/shhome.html

Copyright (C) 1997-2000
University Corporation for Atmospheric Research

the use of this Software is governed by a License Agreement. read it, love it, respect it 🌸


and that's the whole page, no crumbs left. this one's from the UNIX manual, dated September 1999, sourced from NCAR GRAPHICS, and filed under c_shgrid(3NCARG). slay, bye bestie πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from