PyNGL Home > Functions > Lat/Lon manipulators

Ngl.gc_tarea

Finds the area of a triangular patch on a sphere whose vertices are given in degrees as lat/lon pairs.

Prototype

area = Ngl.gc_tarea(lat1, lon1, lat2, lon2, lat3, lon3, 
                     radius=1.)

Arguments

lat1, lon1

Latitude and longitude, in degrees, of the first vertex. These can be scalars, lists, or NumPy arrays.

lat2, lon2

Latitude and longitude, in degrees, of the second vertex. These can be scalars, lists, or NumPy arrays.

lat3, lon3

Latitude and longitude, in degrees, of the third vertex. These can be scalars, lists, or NumPy arrays.

radius=1.

An optional argument specifying the radius of the sphere.

Return value

area

The desired spherical area which is a scalar if the arguments are scalars, or a NumPy array of the same size as the input arrays otherwise.

Description

This function finds the area of a triangular patch on a sphere whose vertices are given in degrees as lat/lon pairs. The area given is that bounded by arcs of great circles connecting the vertices. The algorithm computes the length of the sides of the triangle in radians, uses those to find the spherical angles, then returns the area as the spherical excess.

See Also

Ngl.gc_convert, Ngl.gc_dist, Ngl.gc_inout, Ngl.gc_interp, Ngl.gc_qarea, Ngl.gc_tarea

Examples

The following:

  import Ngl
  area = Ngl.gc_tarea(0., 0., 0., 90., 90., 90.)
  print "One eighth surface area of a sphere = ", area
produces:
  One eighth surface area of a sphere =  1.57079633896