Learn R Programming

birdring (version 1.6)

orthodrom.dist: orthodromic distance and direction

Description

calculates the orthodromic (great circle, shortest distance) distance between two points on the earth

Usage

orthodrom.dist(x1, y1, x2, y2)

Value

gives back a number or a vector with the distances in km between the two points on earth.

Arguments

x1

x-coordinate/longitude of the first point (in decimal coordinates), can be a scalar or a vector

y1

y-coordinate/latitude of the first point (in decimal coordinates), can be a scalar or a vector

x2

x-coordinate/longitude of the second point (in decimal coordinates), can be a scalar or a vector

y2

y-coordinate/latitude of the second point (in decimal coordinates), can be a scalar or a vector

Author

Fraenzi Korner-Nievergelt

Warning

see details

Details

The function is a wrapper of the distMeeus function of the geosphere package.

References

Imboden, C., Imboden D. (1972) Orthodromic and loxodromic formula for the calculation of distance and direction between ringing and finding place. Vogelwarte 26: 336-346.

See Also

decimal.coord

Examples

Run this code

ringingx<-7.30
ringingy<-47.41
findingx<-5.1
findingy<-32.01
rxdec<-decimal.coord(ringingx)
rydec<-decimal.coord(ringingy)
fxdec<-decimal.coord(findingx)
fydec<-decimal.coord(findingy)     

orthodrom.dist(rxdec, rydec, fxdec, fydec) 

Run the code above in your browser using DataLab