NGGCOG(3NCARG)
β¨ 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 typeREAL. 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 typeREAL. 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 typeREALthat 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 typeREAL, dimensionedNPTS. 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 typeREAL, dimensionedNPTS. 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 typeINTEGER, 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:
- One that brings the circle down to the desired latitude.
- 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
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
- 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