c_csstrid(3NCARG)
β¨ 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 isn > 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 withrlat, as she should πntβ*ntis the number of triangles in the triangulationβ¦ UNLESS*ieris non-zero, in which case*nt = 0(sad girl hours π). now letnbbe the number of boundary points on the convex hull of the data. ifnbis 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*iercomes back as0, then no errors were detected and we are thriving β¨. if*ieris non-zero, then bestieβ¦ go refer to the error list incssgrid_errorsfor 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_overviewc_cssgridc_csstricssgrid_errors
complete documentation for Cssgrid is available at URL
http://ngwww.ucar.edu/ngdoc/ng/ngmath/cssgrid/csshome.html
go read it, iykyk πβ¨
π COPYRIGHT π
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
- 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