c_csvoro(3NCARG)

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

πŸ’– 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 be n > 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 is 0 <= ni < n. pick your fave point. πŸ’…
  • nf β€” a flag for whether this is the first call to c_csvoro retrieving 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 with plat, obviously. ✨
  • rc β€” an array containing circumradii. that's arc lengths in degrees of the angle between a circumcenter and its associated triangle vertices. πŸ“
  • nca β€” *nca is the actual number of circumcenters returned in plat and plon. and heads up: this number may be larger than n if 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 β€” *numv is the number of vertices in the Voronoi polygon enclosing the coordinate (rlat[ni],rlon[ni]). 🎯
  • nv β€” an array containing numv indices for the Voronoi polygon enclosing the coordinate (rlat[ni],rlon[ni]). the indices returned in this array refer to the coordinates returned in plat and plon. for example, if the integer j is an element of the nv array, then (plat[j],plon[j]) is a vertex of the Voronoi polygon enclosing (rlat[ni],rlon[ni]). and the indices in nv list 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 *ier comes back as 0, then no errors were detected. if *ier is 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_overview
  • c_cssgrid
  • cssgrid_errors

also!! complete documentation for Cssgrid is available at URL:

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

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