c_csvorod(3NCARG)

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

✨ 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 be n > 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, with 0 <= ni < n.
  • nf β€” a flag telling the function whether this is the first call to c_csvorod to 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 β€” *nca is the actual number of circumcenters returned in plat and plon. Heads up: this number may be larger than n if 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 β€” *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. So organized. So iconic. πŸ”„βœ¨
  • ier β€” the error return value. If *ier comes back as 0, then no errors were detected β€” we love a clean run 🫢. If *ier is 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_overview
  • c_cssgrid
  • c_csvoro
  • cssgrid_errors

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.


πŸ’€ reminder bestie: this page is UNIX, dated May 2000, and it belongs to 3NCARG β€” that's the source/version and date, so go off and cite it properly, mwah πŸ“πŸ’–
πŸ“¦ where this page comes from