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 beN > 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β¦ unlessIER .NE. 0, in which caseNT = 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
NBis the number of boundary points on the convex hull of the data, ifNB .GE. 3, thenNT = 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
NTfor2*Nwill always work. safe queen π
NTRI(integer, output) β a two-dimensional integer array dimensioned for3 x NT, whereNTis the number of triangles in the triangulation (andNTis at most2*N).NTRIcontains 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 length27*N. Yes, twenty-seven times N. give her room to breathe πRWK(double precision, input) β a work array dimensioned for13*N. π¨ and listen: this work array must be typedDOUBLE 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. IfIERcomes back as0, then no errors were detected, we're slaying, everything's perfect β¨. IfIERis non-zero, then go refer to the man page forcssgrid_errorsfor 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_overviewcssgridcsvoro
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 π
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 ππβ¨
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms