c_csvorod(3NCARG)
β¨ c_csvorod β it's giving Voronoi polygons on a sphere β¨
okay bestie, sit down, hydrate, because we're about to talk about c_csvorod from the NCAR GRAPHICS collection (that's the 3NCARG shelf, section 3, iykyk π ). This is a C function, it lives in the ngmath library, and it does the absolute most: it calculates Voronoi polygons for points on a sphere. No cap. πβ¨
πΈ NAME πΈ
c_csvorod β calculate Voronoi polygons for points on a sphere.
π FUNCTION PROTOTYPE π
void c_csvorod(int, double [], double [],
int, int, double [], double [], double [],
int *, int *, int [], int *);
π¦ SYNOPSIS π¦
void *c_csvorod (n, rlat, rlon, ni, nf, plat, plon, rc,
nca, numv, nv, ier);
π DESCRIPTION π
okay so here's the tea on every single argument, and yes we're doing all of them, because every single one matters:
nβ the number of input data points, and it has to ben > 2. Periodt.rlatβ an array holding the latitudes of the input data, expressed in degrees. Important: the first three points must not be collinear β meaning they can't all lie on a common great circle. Do not do that. It's giving chaos. πrlonβ an array holding the longitudes of the input data, expressed in degrees.niβ the index of the input coordinate you want the Voronoi polygon for, with0 <= ni < n.nfβ a flag telling the function whether this is the first call toc_csvorodto retrieve Voronoi polygons for this dataset (1=yes,0=no). Here's the slay: calls after the first one for a given dataset are much faster than that first call. So don't be out here pretending every call costs the same, bestie. β‘platβ the latitudes for the vertices of the Voronoi polygons. These are circumcenters of circles passing through the Delaunay triangles. And if a coordinate is a boundary point, then the circle may pass through certain "pseudo points" that have been added to the original dataset in order to complete the Voronoi polygon. Yes, they're called pseudo points. Yes, it's a whole thing. πplonβ the longitudes for the vertices of the Voronoi polygons.rcβ an array containing circumradii (arc lengths in degrees of the angle between a circumcenter and its associated triangle vertices).ncaβ*ncais the actual number of circumcenters returned inplatandplon. Heads up: this number may be larger thannif the input dataset has boundary points, because those "pseudo points" may have been added to the original dataset in order to complete the Voronoi polygon set. Not a glitch, it's a feature. πnumvβ*numvis the number of vertices in the Voronoi polygon enclosing the coordinate(rlat[ni],rlon[ni]).nvβ an array containingnumvindices for the Voronoi polygon enclosing the coordinate(rlat[ni],rlon[ni]). The indices returned in this array refer to the coordinates returned inplatandplon. For example, if the integer"j"is an element of thenvarray, then(plat[j],plon[j])is a vertex of the Voronoi polygon enclosing(rlat[ni],rlon[ni]). And the indices innvlist out the vertices of the Voronoi polygon in counter-clockwise order. So organized. So iconic. πβ¨ierβ the error return value. If*iercomes back as0, then no errors were detected β we love a clean run π«Ά. If*ieris non-zero, then refer to the error list in the error table for details. Go look it up, bestie, don't guess.
π USAGE π
You call c_csvorod when you want to determine the Voronoi polygons for data randomly positioned on a sphere. Every call to c_csvorod calculates the vertices for the Voronoi polygon surrounding a specified input point β one point at a time, main character energy, one polygon per call. π
Also, fun fact you should know: c_csvorod is the double precision version of c_csvoro.
π ACCESS π
To use c_csvorod, load the NCAR Graphics library ngmath. That's it, that's the whole vibe check. β
π§ SEE ALSO π§
css_overviewc_cssgridc_csvorocssgrid_errors
Complete documentation for Cssgrid is available at URL http://ngwww.ucar.edu/ngdoc/ng/ngmath/cssgrid/csshome.html
π COPYRIGHT π
Copyright (C) 2000 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
π reminder bestie: this page isUNIX, datedMay 2000, and it belongs to3NCARGβ that's the source/version and date, so go off and cite it properly, mwah ππ
π¦ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms