CalcBearing {TrackReconstruction}R Documentation

Calculate Bearing

Description

Calculates Bearing given initial latitude and longitude and ending latitude and longitude in decimal degrees and returns bearing in radians.

Usage

CalcBearing(initialLat, initialLong, finalLat, finalLong)

Arguments

initialLat

initial Latitude

initialLong

initial Longitude

finalLat

ending Latitude

finalLong

ending Longitude

Details

Data must be provided in decimal degrees (e.g. 162.546). Longitude values west of the prime meridian are 0 to -180. Latitude values south of the equator are 0 to -90. As one travels from point A to point B, the bearing to point B changes. This function calculates the bearing from point A to point B at point A. This function is primarily used internally in the GPStable and GeoReference functions.

Value

Bearing in Radians

Author(s)

Brian Battaile

References

https://www.movable-type.co.uk/scripts/latlong.html

Examples

#Bearing to Los Angeles from New York
Bearing<-CalcBearing(40.7697,-73.9735,34.0522,-118.2428)
Bearing
Bearing*360/(2*pi) #transform radians to degrees

[Package TrackReconstruction version 1.3 Index]