Matrix2D
Canonical path: NemAll_Python_Geometry.Matrix2D
Representation class for 2D matrix
Matrix data organization in memory: [0..8] indexes of array values 0,1, 3,4 - rotation, scaling and shrinking 6,7 - translation
0, 1, 2, 3, 4, 5, 6, 7, 8
All operations are correct only in geometry calculation context and can not be used for calculating with regular 4x4 matrix.
AddDimension
AddDimension() -> Matrix3D
IsIdentity
Check to identity matrix
Returns:
-
bool
–Return true when is matrix identity, otherwise false.
Multiply
Reflection
Reflection(axis: Axis2D)
Reverse
Reverse matrix
This method provide geometrical inverse matrix and can not be used with regular inverse 4x4 matrix calculations.
Geometrical representation: Point3D = { Point3D * Matrix } * Matrix.Reverse()
Returns:
-
bool
–True when operation is successful, otherwise false.
Rotation
Scaling
Scale the matrix
Parameters:
-
scaleX
(float
) –Scale in X axis.
-
scaleY
(float
) –Scale in Y axis.
SetReflection
SetReflection(axis: Axis2D)
SetRotation
SetScaling
Initialize matrix only with scaling factors
Parameters:
-
scaleX
(float
) –Scale in X axis.
-
scaleY
(float
) –Scale in Y axis.
SetTranslation
SetTranslation(vec: Vector2D)
SetValue
Set the matrix element at a specified position
Use this method when you don't want to catch exception by operator[].
Parameters:
-
index
(int
) –Position index <0..9>
-
value
(float
) –Value for set
Returns:
-
bool
–True when operation successful (index is not out of range), otherwise false.
Translate
Translate(vec: Vector2D)
__add__
__getitem__
Get the matrix element at a specified position
This method is checked and throwing Geometry::Exception when index is out of range.
Parameters:
-
index
(int
) –Position index <0..9>
Returns:
-
float
–Returns an element at a specified position.