c_csvoro(3NCARG)
π c_csvoro β the NCAR Graphics glow-up π
ok so bestie. this is a page from the NCAR Graphics manual, and today we're learning about c_csvoro π
it's a C function, it lives in section 3NCARG, and it does exactly one thing extremely well: it calculates Voronoi polygons for points on a sphere. no cap. πβ¨
β¨ NAME β¨
c_csvoro β calculate Voronoi polygons for points on a sphere.
like. that's it. that's the whole job. and it ate. π₯
π§ FUNCTION PROTOTYPE π§
void c_csvoro(int, float [], float [],
int, int, float [], float [], float [],
int *, int *, int [], int *);
yes bestie, that's a lot of arguments. twelve of them. we're gonna go through every single one, don't worry. π
π SYNOPSIS π
void *c_csvoro (n, rlat, rlon, ni, nf, plat, plon, rc,
nca, numv, nv, ier);
πΈ DESCRIPTION πΈ
okay so here's the tea on every single parameter. buckle up, this is the main character section. π
nβ the number of input data points. and it has to ben > 2. three points minimum, bestie, we can't make polygons out of vibes alone. πrlatβ an array holding the latitudes of the input data, expressed in degrees. β οΈ important: the first three points must not be collinear, aka they can't all lie on a common great circle. if they do? we have a problem.rlonβ an array holding the longitudes of the input data, expressed in degrees. that's it. that's the whole thing. π¦niβ the index of the input coordinate you want the Voronoi polygon for. the constraint is0 <= ni < n. pick your fave point. πnfβ a flag for whether this is the first call toc_csvororetrieving Voronoi polygons for this dataset.1= yes it's the first,0= no it's not. and listen: calls subsequent to the first call for a given dataset are much faster than the first call. so like, the first one is doing the heavy lifting and then it's smooth sailing. iconic behavior honestly. β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. (pseudo points!! they're the side characters that make the plot work, iykyk π«Ά)plonβ the longitudes for the vertices of the Voronoi polygons. matching set withplat, obviously. β¨rcβ an array containing circumradii. that's arc lengths in degrees of the angle between a circumcenter and its associated triangle vertices. πncaβ*ncais the actual number of circumcenters returned inplatandplon. and heads up: this number may be larger thannif the input dataset has boundary points, because certain "pseudo points" may have been added to the original dataset in order to complete the Voronoi polygon set. so don't be shocked when the count comes in bigger, it's 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 integerjis 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. βΊ gorgeous. organized. we love a consistent winding order.ierβ the error return value. if*iercomes back as0, then no errors were detected. if*ieris non-zero, then go refer to the error list in the error table for details. π
π USAGE π
c_csvoro is called if you want to determine the Voronoi polygons for data randomly positioned on a sphere. each call to c_csvoro calculates the vertices for the Voronoi polygon surrounding a specified input point. one call, one polygon, one point getting its moment. periodt. π
π ACCESS π
to use c_csvoro, load the NCAR Graphics library ngmath. that's the whole access situation bestie, no gatekeeping. π«Ά
π¦ SEE ALSO π¦
go read these next, they're the friend group:
css_overviewc_cssgridcssgrid_errors
also!! 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.
bestie this is the legal bit and I have to keep it exactly as-is, no editing, no remixing, no aesthetic choices. π«Ά
okay that's the whole page!! you now know c_csvoro better than it knows itself. go forth and polygon. π
β¨
signing off from the UNIX manual, dated May 2000, page c_csvoro(3NCARG) β mwah, love u, bye πππΈ
π¦ 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