bearing {cylcop} | R Documentation |
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.
bearing(point1, point2, fullcirc = FALSE)
point1 |
numeric vector holding the x and y coordinates of the first point. |
point2 |
numeric vector holding the x and y coordinates of the second point. |
fullcirc |
logical value indicating whether the output
should be an angle on |
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)
.
bearing(c(3,5), c(1,4))
bearing(c(3,5), c(1,4), fullcirc = TRUE)