bearing: Bearing between geographical locations

bearingR Documentation

Bearing between geographical locations

Description

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

Usage

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

# 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)

argosfilter documentation built on Sept. 13, 2022, 5:05 p.m.