Learn R Programming

BAMBI (version 2.3.5)

zero_to_2pi: Wrap angles into [-pi, pi] or [0, 2*pi]

Description

Wrap angles into [-pi, pi] or [0, 2*pi]

Usage

zero_to_2pi(x)

minuspi_to_pi(x)

Arguments

x

numeric vector or matrix or data.frame.

Details

minuspi_to_pi wraps x into [-pi, pi], while zero_to_pi wraps x into [0, 2*pi].

Examples

Run this code
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