SHGETNP(3NCARG)

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

✨ SHGETNP ✨

okay bestie, gather round, because this is SHGETNP from the NCAR Graphics crew (that's the manual section 3NCARG, iykyk) and it's literally about finding your nearest neighbors in 3-space πŸ¦‹


πŸ’– NAME πŸ’–

SHGETNP β€” find the nearest points to a specified point in 3-space. no cap, that's the whole job. πŸŽ€


🌸 SYNOPSIS 🌸

CALL SHGETNP (PX, PY, PZ, N, X, Y, Z, IFLAG, IWK, RWK, NP, IER)

✨ DESCRIPTION ✨

okay so here's the whole cast of characters, one by one, no skips:

  • PX β€” (real, input) the X coordinate value for a point P whose nearest neighbor is to be found. πŸ’œ
  • PY β€” (real, input) the Y coordinate value for a point P whose nearest neighbor is to be found. πŸ’œ
  • PZ β€” (real, input) the Z coordinate value for a point P whose nearest neighbor is to be found. πŸ’œ
  • X β€” (real, input) an array containing the X coordinates of the input data points.
  • Y β€” (real, input) an array containing the Y coordinates of the input data points.
  • Z β€” (real, input) an array containing the Z coordinates of the input data points.
  • IFLAG β€” (integer, input) a flag that equals 0 if this is the first call to this subroutine for the given dataset and equals 1 otherwise. first-call energy vs. we-been-here energy, basically. ✨
  • IRK β€” (integer, input) an integer workspace dimensioned for at least 2*N. πŸ‘‘
  • RWK β€” (real, input) a real workspace dimensioned for at least 11*N+6. do not skimp on the space, she needs room to breathe 🫢
  • NP β€” (integer, output) an index such that (X(NP),Y(NP),Z(NP)) is the nearest input data point to P. NP = 0 if IER .NE. 0. On successive calls to this subroutine after the first (that is when IFLAG=1) you can find the Mth closest point to (PX,PY,PZ) with the Mth call. IWK and RWK should not be modified between calls to SHGETNP if you are wanting to find successive nearest neighbors. 🚨 like fr fr, hands off the workspaces.
  • IER β€” (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 man page for shgrid_errors for details. πŸ’€

🌈 USAGE 🌈

SHGETNP is called to find the nearest point to a specified point in 3-space. Successive calls to SHGETNP will determine the point nearest the specified point exclusive of the points found in previous calls, i.e. successive calls can be used to find the N nearest points for any N between one and the maximum number of points in the input dataset. πŸ’…

translation: call her once, get your closest bestie. call her again, and she's like "okay not that one again" and hands you the next closest. keep going and you've got a whole ranked friend group. ⭐


πŸŽ€ ACCESS πŸŽ€

To use SHGETNP, load the NCAR Graphics library ngmath.


πŸ¦‹ SEE ALSO πŸ¦‹

  • shgrid
  • shseti
  • shgeti
  • shgrid_params

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.


okay and that's the whole page bestie, we ate and left zero crumbs πŸ’– this lil legend comes from the UNIX manual, dated September 1999, and it's page SHGETNP(3NCARG) β€” periodt. πŸŽ€βœ¨πŸŒΈ

πŸ“¦ where this page comes from