: dist = departure (long1, long2, lat)
: dist = departure (long1, long2, lat, spheroid)
: dist = departure (long1, long2, lat, angleUnit)
: dist = departure (long1, long2, lat, spheroid, angleUnit)

Compute the distance between two longitudes at a given latitude.

Inputs:

  • long1, long2: the start and end meridians (longitudes), resp., between which the departure distance is to be calculated (angle). If non-scalars the dimensions of long1 and long2 should match.
  • lat: the latitude (parallel) at which the departure distance is to be calculated (angle). Can be a scalar even if long1 and long2 are vectors or nD arrays, in this case all departures are computed at the same latitude. However, if non-scalar its size should match those of long1 and long2 (i.e., for each [long1, long2] pair there should be a distinct lat value).
  • spheroid: referenceEllipsoid parameter struct; default is wgs84. A string value describing the spheroid or a numerical EPSG code is also accepted.
  • angleUnit: string for angular units (’degrees’ or ’radians’, case-insensitive, just the first charachter will do). Default is ’degrees’. Is an ellipsoid is also specified angleUnit only applies to the input values, if not it applies to input and output values.

Output

  • dist: Computed distance (angle). If an ellipsoid is used the answer is in the units of the ellipsoid (length).

Examples

dist = departure (60, 80, 50)
dist =  12.856

Including an ellipsoid

E = wgs84Ellipsoid ("km");
dist = departure (60, 80, 50, E)
dist =  1433.9
# In this case dist is returned in kilometers.
# Call can also be e.g.,:
# dist = departure (60, 80, 50, referenceEllipsoid ("wgs84", "km"))

See also: distance.

Package: mapping