bearing: Bearing between geographical locations

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Function bearing calculates the bearing, in degrees, between two geographical locations. Function bearingTrack calculates the bearing between a sequence of locations.

Usage

1
2
bearing(lat1, lat2, lon1, lon2)
bearingTrack(lat, lon)

Arguments

lat1

latitude of the first location, in decimal degrees

lat2

latitude of the second location, in decimal degrees

lon1

longitude of the first location, in decimal degrees

lon2

longitude of the second location, in decimal degrees

lat

vector of latitudes, in decimal degrees

lon

vector of longitudes, in decimal degrees

Details

Bearings are calculated using spherical trigonometry. Formulas are given in Zwillinger (2003).

Value

bearing returns the bearing, in degrees, between the first location and the second location. 0 is North. bearingTrack returns a vector of bearings between the sequence of locations.

Author(s)

Carla Freitas

References

Zwillinger D. (2003) Standard Mathematical Tables and Formulae, 31st edition. Chapman & Hall/CRC, Boca Raton, FL.

See Also

distance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Bearing between two geographical locations:
lat1<-rnorm(1,80)
lat2<-rnorm(1,80)
lon1<-rnorm(1,20)
lon2<-rnorm(1,20)
bearing(lat1,lat2,lon1,lon2)

# Bearing between a sequence of 10 geographical locations:
lat<-rnorm(10,80)
lon<-rnorm(10,20)
bearingTrack(lat,lon)

Example output

[1] -174.5692
[1] -176.381238   25.331500 -155.751354  -27.038854   18.731919    7.303981
[7] -171.209642    5.391068 -173.736972

argosfilter documentation built on May 30, 2017, 12:20 a.m.