NGGCOG(3NCARG)

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

✨ NGGCOG β€” bestie, it's giving "draw me a circle on the globe" ✨

NCAR GRAPHICS Β· NGGCOG(3NCARG) β€” yes it's a FORTRAN-callable routine, yes it's from the NCAR Graphics crew, and yes I'm about to make spherical geometry feel like a group chat πŸ’…


🌍 NAME

NGGCOG returns the latitudes and longitudes of a set of points that approximate a circle at a given point on the surface of the globe. That's it, that's the whole vibe: you hand it a center and a radius, it hands you back a ring of points. Iconic.


🫢 SYNOPSIS

CALL NGGCOG (CLAT,CLON,CRAD,ALAT,ALON,NPTS)

πŸŽ€ C-BINDING SYNOPSIS

#include <ncarg/ncargC.h>

void c_nggcog(float clat, float clon, float crad, float *alat,
float *alon, int npts)

πŸ’– DESCRIPTION

Okay so here's the whole cast of characters, one by one, no skips:

  • CLAT β€” an input expression of type REAL. It's the latitude, in degrees, of the point on the globe that's defining the center of the circle. Main character energy, lowkey.
  • CLON β€” an input expression of type REAL. The longitude, in degrees, of that same point on the globe defining the center of the circle. CLAT and CLON are a package deal, fr fr.
  • CRAD β€” an input expression of type REAL that specifies the radius of the circle. And here's the lil plot twist: this is given as a great-circle distance, in degrees. Not miles, not kilometers, degrees of arc. Slay but be aware.
  • ALAT β€” an output array, of type REAL, dimensioned NPTS. This is where the latitudes of the points on the circle get returned to you. It's an output array so please don't come in with expectations, it's filling itself in.
  • ALON β€” an output array, of type REAL, dimensioned NPTS. Same deal, but for the longitudes of the points on the circle. ALAT and ALON are besties who always show up together.
  • NPTS β€” an input expression, of type INTEGER, and it's the desired number of points to be used to represent the circle. Its value determines how accurately the circle will be represented. More points, more accurate, more ✨. You already knew that.

πŸ¦‹ C-BINDING DESCRIPTION

The C binding argument descriptions are the same as the FORTRAN argument descriptions. That's the whole section. Not me being lazy, that's literally what it says β€” the descriptions match, character for character, vibe for vibe. 🫢


🌈 USAGE

Let C represent (CLAT,CLON), and let O represent the center of the globe. The circle is the set of all points P on the globe such that the angle POC is of the size specified by CRAD. So yeah β€” it's every point that's exactly CRAD degrees of arc away from your center. A perfect lil ring around your spot on the planet. πŸ’–

And the way it actually does this? SIN and COS are used to generate points representing a circle having the desired radius and centered at the North Pole. Then those points get subjected to two rotations:

  1. One that brings the circle down to the desired latitude.
  2. Another that carries it to the desired longitude.

So it builds the circle somewhere convenient (the pole, where the math is cute) and then rotates it into place. Genuinely such a smart move. Obsessed with the efficiency, honestly.


🌸 EXAMPLES

Use the ncargex command to see the following relevant example: cpex10.

That's your demo, bestie. Go run it, it eats.


πŸ‘‘ ACCESS

To use NGGCOG or c_nggcog, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order. Don't be chaotic about the order, the linker will not be your friend. πŸ’…


πŸ’€ MESSAGES

None.

(Truly nothing. Silence. The routine has nothing to say for itself and honestly? Respect.)


πŸ”₯ SEE ALSO

  • Online: nggsog(3NCARG)
  • Online: ngritd(3NCARG)

Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.

Legal stuff but make it cute: it's theirs, it's licensed, read the agreement, don't just vibe and assume. 🫢

Okay that's the whole page, you ate that. πŸ’…βœ¨ This was NGGCOG(3NCARG) from the NCAR GRAPHICS manual, last touched in March 1993, living on a UNIX system β€” and it still slays. Go draw your circle, bestie, ily πŸŽ€πŸŒˆπŸ¦‹

πŸ“¦ where this page comes from