: aq = areaquad (lat1, lon1, lat2, lon2)
: aq = areaquad (lat1, lon1, lat2, lon2, spheroid)
: aq = areaquad (lat1, lon1, lat2, lon2, angleUnit)
: aq = areaquad (lat1, lon1, lat2, lon2, spheroid, angleUnit)

Returns the area of a quadrilateral given two points.

If no ellipsoid is given the result will be a fraction of a unit sphere with a radius of one meter. If an ellipsoid struct is supplied the result’s unit will be the squared unit of that ellipsoid; otherwise, if just an ellipsoid name is given result will be in standard units squared (e.g., m^2).

Input

  • lat1, lon1: the first point of the quadrilateral.
  • lat2, lon2: the second point of the quadrilateral.

These coordinate inputs be scalars, vectors or 2D arrays. If any of these is non-scalar, all other LAT/LON inputs must either have the same size or be scalars.

  • (optional) spheroid: referenceEllipsoid parameter struct; default is ’Unit Sphere’. A string value or EPSG code describing the spheroid is also accepted. Alternatively, a numerical vector [semimajoraxis eccentricity] can be supplied. If specified, spheroid must be the 5th input argument.
  • (optional) angleUnit: string for angular units (’degrees’ or ’radians’, case-insensitive, just the first charachter will do). Default is ’degrees’. If specified, angleUnit must be the last input argument.

Output:

  • aq: the area of the quadrilateral. If one or more of the inputs were vectors or arrays, areaquad’s output will have the same size.

Example No ellipsoid (fraction of a sphere)

aq = areaquad (0, 0, 90, 360)
aq =  0.50000

With radians

aq = areaquad (0, 0, pi / 2 , 2 * pi, "radians")
aq =  0.50000

With ellipsoid in m^2

aq = areaquad (0, 0, 90, 360, "wgs84")
aq =    2.5503e+14

With vector

aq = areaquad(-90,0,90,360,[6000 0]);
aq =    4.5239e+08

See also: referenceEllipsoid,referenceSphere.

Package: mapping