Rotate

0th

Percentile

Rotate a Geometric Structure

Rotate a geometric structure by an angle theta around a centerpoint xy.

Keywords
aplot
Usage
Rotate(x, y = NULL, mx = NULL, my = NULL, theta = pi/3, asp = 1)
Arguments
x, y
vectors containing the coordinates of the vertices of the polygon , which has to be rotated. The coordinates can be passed in a plotting structure (a list with x and y components), a two-column matrix, .... See xy.coords.

mx, my
xy-coordinates of the center of the rotation. If left to NULL, the centroid of the structure will be used.

theta
angle of the rotation

asp
the aspect ratio for the rotation. Helpful for rotate structures along an ellipse.
Value

See Also

polygon, DrawRegPolygon, DrawEllipse, DrawArc

Aliases
  • Rotate
Examples
# let's have a triangle
Canvas(main="Rotation")
x <- DrawRegPolygon(nv=3)[[1]]

# and rotate
sapply( (0:3) * pi/6, function(theta) {
  xy <- Rotate( x=x, theta=theta )
  polygon(xy, col=SetAlpha("blue", 0.2))
} )

abline(v=0, h=0)
Documentation reproduced from package DescTools, version 0.99.19, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.