Computes the heading (radians counter clockwise from north or vertical)

bearing.xy(x1, x2, y1, y2)

Arguments

x1

Numeric; point A x value

x2

numeric; point B x value

y1

numeric; point A y value

y2

numeric; point B y value

Value

A single value in radians a single value in radians

Examples

#example
A <- c(0,0)
B <- c(-5,5)
thet <- bearing.xy(A[1],B[1],A[2],B[2])
deg(thet)
#> [1] 45