1SHGETNP(3NCARG) NCAR GRAPHICS SHGETNP(3NCARG)
2
3
4
6 SHGETNP - find the nearest points to a specified point in 3-space.
7
9 CALL SHGETNP (PX, PY, PZ, N, X, Y, Z, IFLAG, IWK, RWK, NP, IER)
10
12 PX (real,input) The X coordinate value for a point P whose
13 nearest neighbor is to be found.
14
15 PY (real,input) The Y coordinate value for a point P whose
16 nearest neighbor is to be found.
17
18 PZ (real,input) The Z coordinate value for a point P whose
19 nearest neighbor is to be found.
20
21 X (real, input) An array containing the X coordinates of the
22 input data points.
23
24 Y (real, input) An array containing the Y coordinates of the
25 input data points.
26
27 Z (real, input) An array containing the Z coordinates of the
28 input data points.
29
30 IFLAG (integer, input) A flag that equals 0 if this is the first
31 call to this subroutine for the given dataset and equals 1
32 otherwise.
33
34 IRK (integer, input) An integer workspace dimensioned for at
35 least 2*N.
36
37 RWK (real, input) A real workspace dimensioned for at least
38 11*N+6.
39
40 NP (integer, output) An index such that (X(NP),Y(NP),Z(NP)) is
41 the nearest input data point to P. NP = 0 if IER .NE. 0. On
42 successive calls to this subroutine after the first (that
43 is when IFLAG=1) you can find the Mth closest point to
44 (PX,PY,PZ) with the Mth call. IWK and RWK should not be
45 modified between calls to SHGETNP if you are wanting to
46 find successive nearest neighbors.
47
48 IER (integer, output) An error return value. If IER is
49 returned as 0, then no errors were detected. If IER is non-
50 zero, then refer to the man page for shgrid_errors for
51 details.
52
54 SHGETNP is called to find the nearest point to a specified point in
55 3-space. Successive calls to SHGETNP will determine the point nearest
56 the specified point exclusive of the points found in previous calls,
57 i.e. successive calls can be used to find the N nearest points for any
58 N between one and the maximum number of points in the input dataset.
59
61 To use SHGETNP, load the NCAR Graphics library ngmath.
62
64 shgrid, shseti, shgeti, shgrid_params.
65
66 Complete documentation for Shgrid is available at URL
67 http://ngwww.ucar.edu/ngdoc/ng/ngmath/shgrid/shhome.html
68
70 Copyright (C) 1997-2000
71 University Corporation for Atmospheric Research
72
73 This documentation is free software; you can redistribute it and/or
74 modify it under the terms of the GNU General Public License as pub‐
75 lished by the Free Software Foundation; either version 2 of the
76 License, or (at your option) any later version.
77
78 This software is distributed in the hope that it will be useful, but
79 WITHOUT ANY WARRANTY; without even the implied warranty of MER‐
80 CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
81 Public License for more details.
82
83 You should have received a copy of the GNU General Public License along
84 with this software; if not, write to the Free Software Foundation,
85 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
86
87
88
89
90UNIX September 1999 SHGETNP(3NCARG)