bearing: Compass Bearing of a Line Between 2 Points
Description
The angle between a line between 2 points in Euclidean 2-D space and the line from
(0,0) to (0,1) is calculated. In other words, the compass bearing of a line
between 2 points where north is 0. Angles increase in clockwise direction.
Usage
bearing(point1, point2, fullcirc = FALSE)
Value
If fullcirc = FALSE, the function returns a numeric
value (angle) from the interval \([-\pi, \pi)\).
If fullcirc = TRUE, the function returns a numeric value numeric from the interval
\([0, 2\pi)\).
Arguments
point1
numericvector holding the
x and y coordinates of the first point.
point2
numericvector holding the
x and y coordinates of the second point.
fullcirc
logical value indicating whether the output
should be an angle on \([0, 2\pi)\) or \([-\pi, \pi)\).