Add/subtract two circular variables in degrees (%cd+% and %cd-%) and radian (%cr+% and %cr-%).

x %cd+% y

x %cd-% y

x %cr+% y

x %cr-% y

Arguments

x, y

Circular values in degrees/radians.

Value

A value between [0, 360) in degrees or [0, 2*pi) in radian.

Examples

90 %cd+% 90
#> [1] 180
250 %cd+% 200
#> [1] 90
25 %cd-% 80
#> [1] 305
pi %cr+% (pi/2)
#> [1] 4.712389