DOKK / manpages / debian 10 / libncarg-dev / c_shgrid.3ncarg.en
c_shgrid(3NCARG) NCAR GRAPHICS c_shgrid(3NCARG)

c_shgrid - interpolate random data in 3-space using a modified Shepard's algorithm

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

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

float *c_shgrid (n, x[], y[], z[], f[], nxo, nyo, nzo, 

xo[], yo[], zo[], ier);

(integer,input) The number of input data points (n > 9).
(float, input) An array dimensioned for n containing the X coordinate values for the input function.
(float, input) An array dimensioned for n containing the Y coordinate values for the input function.
(float, input) An array dimensioned for n containing the Z coordinate values for the input function.
(float, input) An array containing the functional values of the input function -- f[k] is the functional value at (xi[k], yi[k], zi[k]) for k=0,n-1.
(integer, input) The number of X coordinate values to be calculated for the output grid.
(integer, input) The number of Y coordinate values to be calculated for the output grid.
The number of Z coordinate values to be calculated for the output grid.
(float, input) An array dimensioned for nxo containing the X coordinates of the output grid.
(float, output) An array dimensioned for nyo containing the Y coordinates of the output grid.
(float, output) An array dimensioned for nzo containing the Z coordinates of the output grid.
(pointer to integer, output) An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

c_shgrid is called to interpolate randomly spaced data in 3-space. c_shgrid uses a modified Shepard's algorithm to construct an interpolatory surface.

c_shgrid returns a pointer to a linear array of data that is the interpolation grid stored in row-major order. That 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 internal to c_shgrid and is nx*ny*nz floats in size.

To use c_shgrid, load the NCAR Graphics library ngmath.

shgrid_params, c_shseti, c_shgeti, c_shgetnp.

Complete documentation for Shgrid is available at URL
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.

September 1999 UNIX