Angular difference in degrees

diff_degrees(degree1, degree2 = NULL, ...)

Arguments

degree1

numeric vector that contains angles in degrees.

degree2

numeric vector that contains angles in degrees, or NULL when the input should only consider degree1.

...

additional arguments are ignored.

Details

This function simply returns the difference between two angles in degrees. When degree1 and degree2 are vectors, this function operates on the full set in one step.

When degree1 is a vector, and degree2 is NULL, this function calculates the difference of each pair in degree1, in the order supplied.

Examples

diff_degrees(5, 355)
#> [1] -10
diff_degrees(355, 5)
#> [1] 10
diff_degrees(-10, 5)
#> [1] 15
diff_degrees(-10, 355)
#> [1] 5
diff_degrees(180, 361)
#> [1] -179