distCosine | R Documentation |
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.
distCosine(p1, p2, r=6378137)
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 |
Vector of distances in the same unit as r
(default is meters)
Robert Hijmans
https://en.wikipedia.org/wiki/Great_circle_distance
distGeo, distHaversine, distVincentySphere, distVincentyEllipsoid, distMeeus
distCosine(c(0,0),c(90,90))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.