A 3x2 matrix representing an affine 2D
transformation.
Added in version 2.9.2.
Default constructor. |
|
Concatenate this matrix with another one. |
|
Get the component values of the matrix. |
|
Invert this matrix. |
|
Check that this matrix is identical with t. |
|
Check if this is the identity matrix. |
|
Add mirroring to this matrix. |
|
Add clockwise rotation to this matrix. |
|
Add scaling to this matrix. |
|
Set all elements of this matrix. |
|
Applies the linear part of this matrix, i.e. without translation. |
|
Applies this matrix to the point. |
|
Add the translation to this matrix. |
|
Check that this matrix differs from t. |
|
Check that this matrix is identical with t. |
Possible constructors:
AffineMatrix2D() -> None
A 3x2 matrix representing an affine 2D
transformation.
Default constructor.
The matrix elements are initialize to the identity matrix.
None
Concatenate this matrix with another one.
The parameter matrix is the multiplicand.
t (wx.AffineMatrix2DBase) – The multiplicand.
None
# | t.m_11 t.m_12 0 | | m_11 m_12 0 |
# matrix' = | t.m_21 t.m_22 0 | x | m_21 m_22 0 |
# | t.m_tx t.m_ty 1 | | m_tx m_ty 1 |
Get the component values of the matrix.
Tuple[Matrix2D, Point2DDouble]
Invert this matrix.
If the matrix is not invertible, i.e. if its determinant is 0, returns False
and doesn’t modify it.
# | m_11 m_12 0 |
# Invert | m_21 m_22 0 |
# | m_tx m_ty 1 |
bool
Check that this matrix is identical with t.
t (wx.AffineMatrix2DBase) – The matrix compared with this.
None
Check if this is the identity matrix.
bool
Add mirroring to this matrix.
direction (int) – The direction(s) used for mirroring. One of wx.HORIZONTAL
, wx.VERTICAL
or their combination wx.BOTH
.
None
Add clockwise rotation to this matrix.
cRadians (wx.Double) – Rotation angle in radians, clockwise.
None
# | cos sin 0 | | self.11 self.12 0 |
# matrix' = | -sin cos 0 | x | self.21 self.22 0 |
# | 0 0 1 | | self.tx self.ty 1 |
Add scaling to this matrix.
xScale (wx.Double) – Scaling in x direction.
yScale (wx.Double) – Scaling in y direction.
None
# | xScale 0 0 | | self.11 self.12 0 |
# matrix' = | 0 yScale 0 | x | self.21 self.22 0 |
# | 0 0 1 | | self.tx self.ty 1 |
Set all elements of this matrix.
mat2D (wx.Matrix2D) – The rotational components of the matrix (upper 2 x 2).
tr (Point2DDouble) – The translational components of the matrix.
None
TransformDistance (self, p : Point2DDouble)
Applies the linear part of this matrix, i.e. without translation.
p (Point2DDouble) – The source receiving the transformations.
Point2DDouble
# | self.11 self.12 0 |
# dist' = | src.self.x src._my 0 | x | self.21 self.22 0 |
# | self.tx self.ty 1 |
The source with the transformations applied.
TransformDistance (self, dx : float, dy : float)
dx (wx.Double)
dy (wx.Double)
Tuple[float, float]
TransformPoint (self, p : Point2DDouble)
Applies this matrix to the point.
p (Point2DDouble) – The point receiving the transformations.
Point2DDouble
# | self.11 self.12 0 |
# point' = | src.self.x src._my 1 | x | self.21 self.22 0 |
# | self.tx self.ty 1 |
The point with the transformations applied.
TransformPoint (self, x : float, y : float)
x (wx.Double)
y (wx.Double)
Tuple[float, float]
Add the translation to this matrix.
dx (wx.Double) – The translation in x direction.
dy (wx.Double) – The translation in y direction.
None
# | 1 0 0 | | self.11 self.12 0 |
# matrix' = | 0 1 0 | x | self.21 self.22 0 |
# | dx dy 1 | | self.tx self.ty 1 |
Check that this matrix differs from t.
t (wx.AffineMatrix2DBase) – The matrix compared with this.
Check that this matrix is identical with t.
t (wx.AffineMatrix2DBase) – The matrix compared with this.