geodesic function

geodesic and inverse geodesic problem

geodesic and inverse geodesic problem

Highly accurate estimate of the 'geodesic problem' (find location and azimuth at arrival when departing from a location, given an direction (azimuth) at departure and distance) and the 'inverse geodesic problem' (find the distance between two points and the azimuth of departure and arrival for the shortest path. Computations are for an ellipsoid (default is WGS84 ellipsoid).

This is a direct implementation of the the GeographicLib code by C.F.F. Karney that is also used in several other functions in this package (for example, in distGeo and areaPolygon). 1.1

geodesic(p, azi, d, a=6378137, f=1/298.257223563, ...) geodesic_inverse(p1, p2, a=6378137, f=1/298.257223563, ...)

Arguments

  • p: longitude/latitude of point(s). Can be a vector of two numbers, a matrix of 2 columns (first column is longitude, second column is latitude) or a SpatialPoints* object
  • p1: as above
  • p2: as above
  • azi: numeric. Azimuth of departure in degrees
  • d: numeric. Distance in meters
  • a: numeric. Major (equatorial) radius of the ellipsoid. The default value is for WGS84
  • f: numeric. Ellipsoid flattening. The default value is for WGS84
  • ...: additional arguments (none implemented)

Returns

Three column matrix with columns 'longitude', 'latitude', 'azimuth' (geodesic); or 'distance' (in meters), 'azimuth1' (of departure), 'azimuth2' (of arrival) (geodesic_inverse)

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

Author(s)

This function calls GeographicLib code by C.F.F. Karney

References

C.F.F. Karney, 2013. Algorithms for geodesics, J. Geodesy 87: 43-55. tools:::Rd_expr_doi("10.1007/s00190-012-0578-z") . Addenda: https://geographiclib.sourceforge.io/geod-addenda.html. Also see https://geographiclib.sourceforge.io/

See Also

distGeo

Examples

geodesic(cbind(0,0), 30, 1000000) geodesic_inverse(cbind(0,0), cbind(90,90))
  • Maintainer: Robert J. Hijmans
  • License: GPL (>= 3)
  • Last published: 2024-10-04

Useful links