| 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
Aget or set the matrix
Abget or set the vector
b
Methods
Public methods
Method new()
Create a new Affine object.
Usage
Affine$new(A, b)
Arguments
Athe 2x2 matrix of the affine map
bthe 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
transfoan
Affineobjectleftlogical, whether to compose at left or at right (i.e. returns
f1 o f0orf0 o f1)
Returns
An Affine object.
Method transform()
Transform a point or several points by the reference affine map.
Usage
Affine$transform(M)
Arguments
Ma 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
linea
Lineobject
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
ellan
Ellipseobject or aCircleobject
Returns
An Ellipse object.
Method clone()
The objects of this class are cloneable with this method.
Usage
Affine$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
## ------------------------------------------------
## Method `Affine$print`
## ------------------------------------------------
Affine$new(rbind(c(3.5,2),c(0,4)), c(-1, 1.25))