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

nggcog

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

Prototype

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

Arguments

clat
clon

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

crad

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

alat
alon

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

Description

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,

Examples

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"

begin
  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.

  nggcog(40.,-105.3,7.0,clat,clon)

; 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)
  frame(wks)
end