c_csstrid(3NCARG)

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

✨ c_csstrid β€” bestie, let's triangulate a SPHERE πŸ’…

okay so this is a page from the NCAR GRAPHICS manual, section 3NCARG, and it's all about c_csstrid β€” the girlies who calculate a Delaunay triangulation for data on a sphere. yes, a sphere. we're doing geometry in 3D today, no cap 🌍✨


πŸŽ€ NAME πŸŽ€

c_csstrid β€” calculates a Delaunay triangulation for data on a sphere. that's it, that's the whole job, and she does it flawlessly πŸ’–


πŸ¦‹ FUNCTION PROTOTYPE πŸ¦‹

int *c_csstrid(int, double [], double [], int *, int *);

look at her. iconic signature. int * return type, meaning she hands you back a pointer and you better treat it right 🫢


🌸 SYNOPSIS 🌸

int *c_csstrid(n, rlat, rlon, nt, ier);

five args, one dream. let's break them down bestie ⬇️


✨ DESCRIPTION ✨

  • n β€” the number of input data points, and the vibe check here is n > 2. literally you need more than two points, that's non-negotiable πŸ’€
  • rlat β€” an array holding the latitudes of your input data, expressed in degrees. ⚠️ important: the first three points must not be collinear β€” as in, they can't all lie on a common great circle. don't do it. she will not be happy.
  • rlon β€” an array holding the longitudes of your input data, also in degrees. matching set with rlat, as she should πŸ’…
  • nt β€” *nt is the number of triangles in the triangulation… UNLESS *ier is non-zero, in which case *nt = 0 (sad girl hours 😭). now let nb be the number of boundary points on the convex hull of the data. if nb is greater than 3, then *nt = 2n-nb-2. otherwise *nt = 2n-4. and for the record, the input data are considered to be bounded if they all lie in one hemisphere 🌐
  • ier β€” the error return value. if *ier comes back as 0, then no errors were detected and we are thriving ✨. if *ier is non-zero, then bestie… go refer to the error list in cssgrid_errors for the details. she's telling you something. listen. πŸ™ˆ

πŸ’– USAGE πŸ’–

you call c_csstrid to find a Delaunay triangulation of data randomly positioned on the surface of a sphere. that's the whole point, that's her main character moment πŸ‘‘

also, tea: c_csstrid is the double precision version of c_csstri. same energy, more precision, periodt πŸ’…


πŸ”₯ RETURN VALUE πŸ”₯

c_csstrid returns a pointer to a linear array that contains a sequence of integer triples. each element of a triple is an index of a vertex of a triangle, and each index references an original data point as it occurs in sequence in the input data set. ⚠️ numbering starts at 0 β€” zero-indexed girlies rise up 🫢

so like, if the triple <5,0,2> were in the list of triples, then (rlat[5],rlon[5]), (rlat[0],rlon[0]), and (rlat[2],rlon[2]) would be vertices of a triangle in the Delaunay triangulation. see how that works? chef's kiss 🀌


🌈 ACCESS 🌈

to use c_csstrid, load the NCAR Graphics library ngmath. that's the one. don't forget it or she simply will not run πŸ’€


πŸ’œ SEE ALSO πŸ’œ

  • css_overview
  • c_cssgrid
  • c_csstri
  • cssgrid_errors

complete documentation for Cssgrid is available at URL

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

go read it, iykyk πŸ“šβœ¨


Copyright (C) 2000 University Corporation for Atmospheric Research

The use of this Software is governed by a License Agreement.


okay that's the whole page bestie, you're officially a sphere-triangulation girly now πŸ§šπŸ’– go forth and Delaunay

this lil masterpiece dropped as part of UNIX, back in May 2000, from the NCAR GRAPHICS source β€” vintage but make it slay πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from