CSSTRI(3NCARG)

πŸ’– CSSTRI β€” the NCAR Graphics girlies' Delaunay-on-a-sphere moment πŸ’–

okay so bestie, welcome to the CSSTRI page from 3NCARG (that's the NCAR Graphics manual, mwah). This one is literally the function that calculates a Delaunay triangulation for data on a sphere. Yes, a sphere. Not a flat little grid, a whole globe. iconic behavior only 🌍✨


✨ SYNOPSIS ✨

CALL CSSTRI (N, RLAT, RLON, NT, NTRI, IWK, RWK, IER)

That's it. One call, seven arguments, a whole triangulation. she's efficient πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

okay let's go through the whole cast of characters one by one, no skips, because every single one of these matters:

  • N (integer, input) β€” the number of input data points, and she has got to be N > 2. Two points is not a triangulation, that's just a line, bestie 😭
  • RLAT (real, input) β€” an array holding the latitudes of the input data, expressed in degrees. ⚠️ Warning bestie: the first three points must not be collinear β€” as in, they cannot lie on a common great circle. If they do, that's a whole problem, so don't do that.
  • RLON (real, input) β€” an array holding the longitudes of the input data, also expressed in degrees. 🌸
  • NT (integer, output) β€” the number of triangles in the triangulation… unless IER .NE. 0, in which case NT = 0. So if the error flag is non-zero, she gives you zero triangles and that's that.

Okay and here's the math, because the math is giving:

  • Where NB is the number of boundary points on the convex hull of the data, if NB .GE. 3, then NT = 2N-NB-2.
  • Otherwise, NT=2N-4.
  • The input data are considered to be bounded if they all lie in one hemisphere.
  • And pro tip: dimensioning NT for 2*N will always work. safe queen πŸ‘‘
  • NTRI (integer, output) β€” a two-dimensional integer array dimensioned for 3 x NT, where NT is the number of triangles in the triangulation (and NT is at most 2*N). NTRI contains the triangulation data. The vertices of the Kth triangle are:
(PLAT(NTRI((1,K)),PLON(NTRI(1,K)),
(PLAT(NTRI((2,K)),PLON(NTRI(2,K)),
(PLAT(NTRI((3,K)),PLON(NTRI(3,K))

three corners per triangle, exactly as written, no notes 🫢

  • IWK (integer, input) β€” an integer workspace of length 27*N. Yes, twenty-seven times N. give her room to breathe πŸ’œ
  • RWK (double precision, input) β€” a work array dimensioned for 13*N. 🚨 and listen: this work array must be typed DOUBLE PRECISION. Like, actually. Don't come at her with single precision and expect the vibe check to pass.
  • IER (integer, output) β€” the error return value. If IER comes back as 0, then no errors were detected, we're slaying, everything's perfect ✨. If IER is non-zero, then go refer to the man page for cssgrid_errors for the details. she will tell you what went wrong.

πŸ¦‹ USAGE πŸ¦‹

So when do you actually call her? You call CSSTRI to find a Delaunay triangulation of data randomly positioned on the surface of a sphere. That's the whole assignment. globe girlies rise 🌈


πŸ‘‘ ACCESS πŸ‘‘

To use CSSTRI, load the NCAR Graphics library ngmath. that's it, that's the door key πŸ”‘


🌟 SEE ALSO 🌟

go read these next, bestie, they're the friend group:

  • css_overview
  • cssgrid
  • csvoro

and also β€” complete documentation for Cssgrid is available at this URL:

http://ngwww.ucar.edu/ngdoc/ng/ngmath/cssgrid/csshome.html

bookmark her, iykyk πŸ’–


Copyright (C) 2000 University Corporation for Atmospheric Research

The use of this Software is governed by a License Agreement. (so like, be normal about it, okay?)


okay that's the whole page bestie, you ate πŸ’… This was the UNIX release, dated May 2000, and it lives in the manual as CSSTRI(3NCARG) β€” go forth and triangulate that sphere, mwah πŸ˜˜πŸŽ€βœ¨