| Rotation {PlaneGeometry} | R Documentation |
R6 class representing a rotation
Description
A rotation is given by an angle (theta) and a center.
Active bindings
thetaget or set the angle of the rotation
centerget or set the center
degreesget or set the
degreesfield
Methods
Public methods
Method new()
Create a new Rotation object.
Usage
Rotation$new(theta, center, degrees = TRUE)
Arguments
thetaa number, the angle of the rotation
centera point, the center of the rotation
degreeslogical, whether
thetais given in degrees
Returns
A new Rotation object.
Examples
Rotation$new(60, c(1,1))
Method print()
Show instance of a Rotation object.
Usage
Rotation$print(...)
Arguments
...ignored
Method rotate()
Rotate a point or several points.
Usage
Rotation$rotate(M)
Arguments
Ma point or a two-column matrix of points, one point per row
Method transform()
An alias of rotate.
Usage
Rotation$transform(M)
Arguments
Ma point or a two-column matrix of points, one point per row
Method rotateCircle()
Rotate a circle.
Usage
Rotation$rotateCircle(circ)
Arguments
circa
Circleobject
Returns
A Circle object.
Method transformCircle()
An alias of rotateCircle.
Usage
Rotation$transformCircle(circ)
Arguments
circa
Circleobject
Returns
A Circle object.
Method rotateEllipse()
Rotate an ellipse.
Usage
Rotation$rotateEllipse(ell)
Arguments
ellan
Ellipseobject
Returns
An Ellipse object.
Method transformEllipse()
An alias of rotateEllipse.
Usage
Rotation$transformEllipse(ell)
Arguments
ellan
Ellipseobject
Returns
An Ellipse object.
Method rotateLine()
Rotate a line.
Usage
Rotation$rotateLine(line)
Arguments
linea
Lineobject
Returns
A Line object.
Method transformLine()
An alias of rotateLine.
Usage
Rotation$transformLine(line)
Arguments
linea
Lineobject
Returns
A Line object.
Method getMatrix()
Augmented matrix of the rotation.
Usage
Rotation$getMatrix()
Returns
A 3x3 matrix.
Examples
R <- Rotation$new(60, c(1,1)) P <- c(1,5) R$rotate(P) R$getMatrix() %*% c(P,1)
Method asAffine()
Convert the reference rotation to an Affine object.
Usage
Rotation$asAffine()
Method clone()
The objects of this class are cloneable with this method.
Usage
Rotation$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
## ------------------------------------------------
## Method `Rotation$new`
## ------------------------------------------------
Rotation$new(60, c(1,1))
## ------------------------------------------------
## Method `Rotation$getMatrix`
## ------------------------------------------------
R <- Rotation$new(60, c(1,1))
P <- c(1,5)
R$rotate(P)
R$getMatrix() %*% c(P,1)