powered by
[-pi, pi]
[0, 2*pi]
Wrap angles into [-pi, pi] or [0, 2*pi]
zero_to_2pi(x)minuspi_to_pi(x)
minuspi_to_pi(x)
numeric vector or matrix or data.frame.
minuspi_to_pi wraps x into [-pi, pi], while zero_to_pi wraps x into [0, 2*pi].
minuspi_to_pi
x
zero_to_pi
dat <- matrix(runif(100, -pi, pi), ncol=2) dat1 <- zero_to_2pi(dat) dat2 <- minuspi_to_pi(dat1) all.equal(dat, dat2)
Run the code above in your browser using DataLab