distMeeus function

'Meeus' great circle distance

'Meeus' great circle distance

The shortest distance between two points on an ellipsoid (the 'geodetic'), according to the 'Meeus' method. distGeo should be more accurate. 1.1

distMeeus(p1, p2, a=6378137, f=1/298.257223563)

Arguments

  • p1: longitude/latitude of point(s), in degrees 1; can be a vector of two numbers, a matrix of 2 columns (first one is longitude, second is latitude) or a SpatialPoints* object
  • p2: as above; or missing, in which case the sequential distance between the points in p1 is computed
  • a: numeric. Major (equatorial) radius of the ellipsoid. The default value is for WGS84
  • f: numeric. Ellipsoid flattening. The default value is for WGS84

Details

Parameters from the WGS84 ellipsoid are used by default. It is the best available global ellipsoid, but for some areas other ellipsoids could be preferable, or even necessary if you work with a printed map that refers to that ellipsoid. Here are parameters for some commonly used ellipsoids:

ellipsoidaf
WGS8463781371/298.257223563
GRS8063781371/298.257222101
GRS6763781601/298.25
Airy 18306377563.3961/299.3249646
Bessel 18416377397.1551/299.1528434
Clarke 18806378249.1451/293.465
Clarke 18666378206.41/294.9786982
International 192463783881/297
Krasovsky 194063782451/298.2997381

more info: https://en.wikipedia.org/wiki/Reference_ellipsoid

Returns

Distance value in the same units as parameter a of the ellipsoid (default is meters)

Note

This algorithm is also used in the spDists function in the sp package

References

Meeus, J., 1999 (2nd edition). Astronomical algoritms. Willman-Bell, 477p.

Author(s)

Robert Hijmans, based on a script by Stephen R. Schmitt

See Also

distGeo, distVincentyEllipsoid, distVincentySphere, distHaversine,distCosine

Examples

distMeeus(c(0,0),c(90,90)) # on a 'Clarke 1880' ellipsoid distMeeus(c(0,0),c(90,90), a=6378249.145, f=1/293.465)
  • Maintainer: Robert J. Hijmans
  • License: GPL (>= 3)
  • Last published: 2024-10-04

Useful links