1c_shgrid(3NCARG) NCAR GRAPHICS c_shgrid(3NCARG)
2
3
4
6 c_shgrid - interpolate random data in 3-space using a modified Shep‐
7 ard's algorithm
8
10 float *c_shgrid(int, float [], float [], float [], float [],
11 int, int, int, float [], float [], float [], int*);
12
13
15 float *c_shgrid (n, x[], y[], z[], f[], nxo, nyo, nzo,
16 xo[], yo[], zo[], ier);
17
18
20 n (integer,input) The number of input data points (n > 9).
21
22 xi (float, input) An array dimensioned for n containing the X
23 coordinate values for the input function.
24
25 yi (float, input) An array dimensioned for n containing the Y
26 coordinate values for the input function.
27
28 zi (float, input) An array dimensioned for n containing the Z
29 coordinate values for the input function.
30
31 f (float, input) An array containing the functional values of
32 the input function -- f[k] is the functional value at
33 (xi[k], yi[k], zi[k]) for k=0,n-1.
34
35 nxo (integer, input) The number of X coordinate values to be
36 calculated for the output grid.
37
38 nyo (integer, input) The number of Y coordinate values to be
39 calculated for the output grid.
40
41 nzo The number of Z coordinate values to be calculated for the
42 output grid.
43
44 xo (float, input) An array dimensioned for nxo containing the
45 X coordinates of the output grid.
46
47 yo (float, output) An array dimensioned for nyo containing the
48 Y coordinates of the output grid.
49
50 zo (float, output) An array dimensioned for nzo containing the
51 Z coordinates of the output grid.
52
53 ier (pointer to integer, output) An error return value. If
54 *ier is returned as 0, then no errors were detected. If
55 *ier is non-zero, then refer to the error list in the error
56 table for details.
57
59 c_shgrid is called to interpolate randomly spaced data in 3-space.
60 c_shgrid uses a modified Shepard's algorithm to construct an interpola‐
61 tory surface.
62
63 c_shgrid returns a pointer to a linear array of data that is the inter‐
64 polation grid stored in row-major order. That is, if out is declared as
65
66 float *out;
67
68 and we set:
69
70 out = c_shgrid(n, x, y, z, f, nxo, nyo, nzo, xo, yo, zo, ier);
71
72 then out[nz*ny*i + nz*j + k] is the approximation function value at
73 coordinate point (xo[i], yo[j], zo[k]) for 0 <= i < nx, 0 <= j < ny,
74 and 0 <= k < nz. The space for out is allocated internal to c_shgrid
75 and is nx*ny*nz floats in size.
76
78 To use c_shgrid, load the NCAR Graphics library ngmath.
79
81 shgrid_params, c_shseti, c_shgeti, c_shgetnp.
82
83 Complete documentation for Shgrid is available at URL
84 http://ngwww.ucar.edu/ngdoc/ng/ngmath/shgrid/shhome.html
85
87 Copyright (C) 1997-2000
88 University Corporation for Atmospheric Research
89
90 The use of this Software is governed by a License Agreement.
91
92
93
94UNIX September 1999 c_shgrid(3NCARG)