NCL Website header
NCL Home > Documentation > Functions > Lat/Lon functions


Calculates the latitudes and longitudes of a set of points approximating a circle at a given point on the surface of the globe.


	procedure nggcog (
		clat [1] : numeric,          
		clon [1] : numeric,          
		crad [1] : numeric,          
		alat [*] : float or double,  
		alon [*] : float or double   



The latitude and longitude, in degrees, of a point on the globe defining the center of the circle.


The radius of the circle. This should be given as a great-circle distance, in degrees.


One-dimensional arrays that will contain the calculated latitude and longitude points of the circle.


If you let C represent (clat,clon) and let O represent the center of the globe, then this procedure returns (in the variables alat,alon) the set of all points P on the globe such that the angle POC is of the size specified by crad.

The sine and cosine functions are used to generate points representing a circle having the desired radius and centered at the North Pole. These points are then subjected to two rotations - one that brings the circle down to the desired latitude, and another that carries it to the desired longitude.

This procedure is analogous to Matlab's scircle1 function.

In NCL versions 6.4.0 and earlier, this procedure only allowed float input and output. In NCL versions 6.5.0 and later, the input can be any numeric type, and the output can be float or double.

See Also

gc_aangle, gc_clkwise, gc_dangle, gc_inout, gc_latlon, gc_onarc, gc_pnt2gc, gc_qarea, gc_tarea,


Example 1

This example draws an orthographic map projection with a circle centered around Boulder:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"

  clat = new(100,float)    ; Create arrays to hold great circle.
  clon = new(100,float)    ; As of NCL 6.5.0, can be float or double

  wks = gsn_open_wks("x11","nggcog")   ; Open X11 workstation.


; Set up some map resources.

  mpres              = True
  mpres@gsnMaximize  = True     ; Maximize size of plot in frame.
  mpres@gsnFrame     = False    ; Don't advance the frame.
  mpres@mpCenterLonF = -95.
  mpres@mpCenterLatF =  35.

  map = gsn_map(wks, "Orthographic", mpres)
  gsn_polyline(wks, map, clon, clat, False)