# Wrapping of angles
x <- seq(-3 * pi, 5 * pi, l = 100)
toPiInt(x)
to2PiInt(x)
# Transformation to [1, 5)
x <- 1:10
toInt(x, 1, 5)
toInt(x + 1, 1, 5)
# Transformation to [1, 5]
toInt(x, 1, 6)
toInt(x + 1, 1, 6)
Run the code above in your browser using DataLab