Learn R Programming

Momocs (version 0.2-03)

coo.rotate: Rotates a list or matrix of coordinates.

Description

coo.rotate rotates (counter-clockwise) coo with a theta angle (in radians) .

Usage

coo.rotate(coo, theta)

Arguments

coo
A list or a matrix of coordinates.
theta
numeric. The angle to rotate the shape.

Value

  • A list with x; y components or a a matrix of (x; y)coordinates.

Details

For those not familiar with linear mapping the providence is there: http://en.wikipedia.org/wiki/Linear_mapping

See Also

coo.rotate.center if one wants to rotate shapes with another center of rotation than the origin.

Examples

Run this code
data(bot)
coo <- bot@coo[[1]]
coo.plot(coo,  main="The bottle revolution", xlim=c(-1.5e3, 1.5e3))
r <- seq(pi/6, 2*pi, pi/6)
cols <- col.summer(12)
for (i in seq(along=r)) {
  coo.draw(coo.rotate(coo, r[i]), border=cols[i], col=NA)  
}

Run the code above in your browser using DataLab