1c_shgetnp(3NCARG)                NCAR GRAPHICS               c_shgetnp(3NCARG)
2
3
4

NAME

6       c_shgetnp - find the nearest points to a specified point in 3-space
7

FUNCTION PROTOTYPE

9       int c_shgetnp(float, float, float, int, float *, float *, float *,
10                     int, int *);
11
12

SYNOPSIS

14       int c_shgetnp (px, py, pz, n, x[], y[], z[], iflag, ier );
15
16

DESCRIPTION

18       px          (float)  The X coordinate value for a point P whose nearest
19                   neighbor is to be found.
20
21       py          (float) The Y coordinate value for a point P whose  nearest
22                   neighbor is to be found.
23
24       pz          (float)  The Z coordinate value for a point P whose nearest
25                   neighbor is to be found.
26
27       n           (int) The number of input data points, n > 1.
28
29       x           (float) An array of length n containing  the  X  coordinate
30                   values for the input data points.
31
32       y           (float)  An  array  of length n containing the Y coordinate
33                   values for the input data points.
34
35       z           (float) An array of length n containing  the  Z  coordinate
36                   values for the input data points.
37
38       iflag       (int)  A  flag  that  equals 0 if this is the first call to
39                   this subroutine for the given dataset and equals  1  other‐
40                   wise.
41
42       ier         (pointer  to  int)  An  error  return  value.   If  *ier is
43                   returned as 0, then no errors were  detected.  If  *ier  is
44                   non-zero,  then  look at the man page for shgrid_errors for
45                   details.
46

USAGE

48       c_shgetnp is called to find the nearest point to a specified  point  in
49       3-space. Successive calls to c_shgetnp will determine the point nearest
50       the specified point exclusive of the points found  in  previous  calls,
51       i.e.  successive calls can be used to find the N nearest points for any
52       N between one and the maximum number of points in the input dataset.
53
54       c_shgetnp returns an integer, say np, such that (x[np],y[np],z[np])  is
55       the nearest input data point to P. np = -1 if *ier is not zero. On suc‐
56       cessive calls to this function after the first (that is  when  iflag=1)
57       you can find the Mth closest point to (px,py,pz) with the Mth call.
58

ACCESS

60       To use c_shgetnp, load the NCAR Graphics library ngmath.
61

SEE ALSO

63       shgetnp, c_shgrid, c_shseti, c_shgeti, shgrid_params.
64
65       Complete documentation for Sh is available at URL
66       http://ngwww.ucar.edu/ngdoc/ng/ngmath/shgrid/shhome.html
67
69       Copyright (C) 2000
70       University Corporation for Atmospheric Research
71
72       The use of this Software is governed by a License Agreement.
73
74
75
76UNIX                             January 1999                c_shgetnp(3NCARG)
Impressum