Get the final direction (bearing) when arriving at p2 after starting from p1 and following the shortest path on an ellipsoid (following a geodetic) or on a sphere (following a great circle).
longitude/latitude of point(s). Can be a vector of two numbers, a matrix of 2 columns (first column is longitude, second column is latitude) or a SpatialPoints* object
p2
as above
a
major (equatorial) radius of the ellipsoid. The default value is for WGS84
f
ellipsoid flattening. The default value is for WGS84
sphere
logical. If TRUE, the bearing is computed for a sphere, instead of for an ellipsoid
Author
This function calls GeographicLib code by C.F.F. Karney