CalcBearing: Calculate Bearing

Description Usage Arguments Details Value Author(s) References Examples

View source: R/CalcBearing.R

Description

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

Usage

1
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

1
2
3
4
#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

Example output

Loading required package: fields
Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.1-1 (2017-07-02) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: maps
Loading required package: RColorBrewer
[1] -1.507516
[1] -86.37428

TrackReconstruction documentation built on Dec. 11, 2021, 10:07 a.m.