rotate: Rotate

Description Usage Arguments Author(s) Examples

View source: R/rotate.R

Description

Rotate 2D and complex-valued observations. The output is of the same kind as the input.

Usage

1
rotate (xy, angle, degrees = FALSE, origin = TRUE)

Arguments

xy

Either, a vector of complex-valued observations, or a matrix with 2 columns and any number of rows.

angle

The desired angle of rotation, in radians.

degrees

If angle of rotation is specified in degrees instead of radians, this should be set to TRUE.

origin

If TRUE, points are rotated about the origin. If FALSE, points are rotated 'in place' about the mean for each dimension (i.e. the central location of the distribution).

Author(s)

Santiago Barreda <[email protected]>

Examples

1
2
3
4
5
6
7
## rotate points in a 2D space 
mat = cbind (1:100, 100:1)
rotate (mat, pi/2)

## rotate complex-valued numbers
complx = complex (real = mat[,1], imaginary = mat[,2])
rotate (complx, pi/2)

phonTools documentation built on May 29, 2017, 9 a.m.