Description Usage Arguments Details Value Author(s) References Examples
Calculates Bearing given initial latitude and longitude and ending latitude and longitude in decimal degrees and returns bearing in radians.
1 | CalcBearing(initialLat, initialLong, finalLat, finalLong)
|
initialLat |
initial Latitude |
initialLong |
initial Longitude |
finalLat |
ending Latitude |
finalLong |
ending Longitude |
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.
Bearing in Radians
Brian Battaile
https://www.movable-type.co.uk/scripts/latlong.html
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
|
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.