Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

distCosine

'Law of cosines' great circle distance


Description

The shortest distance between two points (i.e., the 'great-circle-distance' or 'as the crow flies'), according to the 'law of the cosines'. This method assumes a spherical earth, ignoring ellipsoidal effects.

Usage

distCosine(p1, p2, r=6378137)

Arguments

p1

longitude/latitude of point(s). 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

r

radius of the earth; default = 6378137 m

Value

Vector of distances in the same unit as r (default is meters)

Author(s)

Robert Hijmans

References

See Also

Examples

distCosine(c(0,0),c(90,90))

geosphere

Spherical Trigonometry

v1.5-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut], Ed Williams [ctb], Chris Vennes [ctb]
Initial release
2019-05-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.