Affine {PlaneGeometry} | R Documentation |
R6 class representing an affine map.
Description
An affine map is given by a 2x2 matrix (a linear transformation) and a vector (the "intercept").
Active bindings
A
get or set the matrix
A
b
get or set the vector
b
Methods
Public methods
Method new()
Create a new Affine
object.
Usage
Affine$new(A, b)
Arguments
A
the 2x2 matrix of the affine map
b
the shift vector of the affine map
Returns
A new Affine
object.
Method print()
Show instance of an Affine
object.
Usage
Affine$print(...)
Arguments
...
ignored
Examples
Affine$new(rbind(c(3.5,2),c(0,4)), c(-1, 1.25))
Method get3x3matrix()
The 3x3 matrix representing the affine map.
Usage
Affine$get3x3matrix()
Method inverse()
The inverse affine transformation, if it exists.
Usage
Affine$inverse()
Method compose()
Compose the reference affine map with another affine map.
Usage
Affine$compose(transfo, left = TRUE)
Arguments
transfo
an
Affine
objectleft
logical, whether to compose at left or at right (i.e. returns
f1 o f0
orf0 o f1
)
Returns
An Affine
object.
Method transform()
Transform a point or several points by the reference affine map.
Usage
Affine$transform(M)
Arguments
M
a point or a two-column matrix of points, one point per row
Method transformLine()
Transform a line by the reference affine transformation (only for invertible affine maps).
Usage
Affine$transformLine(line)
Arguments
line
a
Line
object
Returns
A Line
object.
Method transformEllipse()
Transform an ellipse by the reference affine transformation (only for an invertible affine map). The result is an ellipse.
Usage
Affine$transformEllipse(ell)
Arguments
ell
an
Ellipse
object or aCircle
object
Returns
An Ellipse
object.
Method clone()
The objects of this class are cloneable with this method.
Usage
Affine$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## ------------------------------------------------
## Method `Affine$print`
## ------------------------------------------------
Affine$new(rbind(c(3.5,2),c(0,4)), c(-1, 1.25))