Description Usage Arguments Value Examples
Function comes in two flavors. Either it calculates the smallest angle [0, 180) or the anti-clockwise angle with respect to the second vector [0, 360).
1 |
a,b |
Vector |
rad |
Angular measure is radian? (default |
mode |
1= smallest angle in [0, 180); 2=anti-clockwise angle with respect #' vector b in [0, 360). |
Angle
1 2 3 4 5 6 7 8 | v <- c(1,0) # point vector
as <- seq(0, 2*pi, length=10) # radians to rotate
# mode 1: between 0 and 180 degrees, minimal angle / radian
for (a in as)
print(vec_angle(v %*% rotation_matrix_2d(a, F), v, mode=1))
# mode 2: between 0 and 360 degrees, anti-clockwise
for (a in as)
print(vec_angle(v %*% rotation_matrix_2d(a, F), v, mode=2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.