geosphere (version 1.2-21)

bearing: Direction of travel

Description

Get the initial bearing (direction; azimuth) to go from p1 to p2 following the shortest path (a Great Circle). Note that the bearing of travel changes continuously while going along a great circle. A route with constant bearing is a rhumb line (see bearingRhumb).

Usage

bearing(p1, p2)

Arguments

p1
longitude/latitude of point(s). Can be a vector of two numbers, a matrix of 2 columns (first one is longitude, second is latitude) or a SpatialPoints* object
p2
as above

Value

  • Bearing in degrees

References

http://williams.best.vwh.net/ftp/avsig/avform.txt http://www.movable-type.co.uk/scripts/latlong.html

See Also

bearingRhumb

Examples

Run this code
bearing(c(10,10),c(20,20))

Run the code above in your browser using DataLab