IMatrix¶
- class IMatrix¶
Bases:
ImpactCOMWrapperBase- Summary:
Represents a 2 x 3 transformation matrix with 2 rows and 3 columns.
- Remarks:
We use the reduced form of the 2-dimensional homogeneous coordinate matrix, ignoring the third row which is always (0,0,1). Elementary transformation operations such as rotations, scales, shifts and mirrors can be combined to form more complex transformations. Introduced in Impact 7.0.0.31.
Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance
- property a11¶
Gets A11.
- Summary:
Element (1,1) of the matrix. This is the value in the first row, first column.
- Returns:
The value of A11.
- Return type:
a11 (float)
- property a12¶
Gets A12.
- Summary:
Element (1,2) of the matrix. This is the value in the first row, second column.
- Returns:
The value of A12.
- Return type:
a12 (float)
- property a13¶
Gets A13.
- Summary:
Element (1,3) of the matrix. This is the value in the first row, third column.
- Returns:
The value of A13.
- Return type:
a13 (float)
- property a21¶
Gets A21.
- Summary:
Element (2,1) of the matrix. This is the value in the second row, first column.
- Returns:
The value of A21.
- Return type:
a21 (float)
- property a22¶
Gets A22.
- Summary:
Element (2,2) of the matrix. This is the value in the second row, second column.
- Returns:
The value of A22.
- Return type:
a22 (float)
- property a23¶
Gets A23.
- Summary:
Element (2,3) of the matrix. This is the value in the second row, third column.
- Returns:
The value of A23.
- Return type:
a23 (float)
- assign(source)¶
- Summary:
Assigns the properties of another IMatrix object to this object.
- Parameters:
source (IMatrix) – Specifies the IMatrix object to assign properties from.
- determinant()¶
- Summary:
Calculates the determinant of the 2-dimensional matrix. The determinant represents the absolute value of the scale factor by which areas are transformed by the matrix.
- Remarks:
If the determinant of the matrix is 0, then the matrix is singular or degenerate.
- identity()¶
- Summary:
Sets the matrix to be the identity or unit matrix. The transformation represented by an identity matrix is that which is neutral, and has no effect.
- inverse()¶
- Summary:
Inverts the matrix. The inverse is such that any matrix multiplied by its inverse is equal to the identity matrix. The transformation represented by the inverse matrix is that which has an opposite effect to the original matrix.
- isNone()¶
Checks if the COM object is None. This is useful for determining if the wrapper has been initialized with a valid COM object.
- mirror_about_axis(axis_start, axis_end)¶
- Summary:
Adds a mirroring transformation (about the specified axis) to the matrix.
- Remarks:
Introduced in Impact 8.0.0.49
Examples:
- mirror_about_x()¶
- Summary:
Adds a mirroring transformation (about the horizontal x-axis) to the matrix.
- mirror_about_y()¶
- Summary:
Adds a mirroring transformation (about the vertical y-axis) to the matrix.
- multiply(matrix)¶
- Summary:
Multiplies the matrix by another.
- Remarks:
The result of multiplying matrix A by matrix B is not the same as the result of multiplying matrix B by matrix A. In general, matrix products are non-commutative; the order is important.
- Parameters:
matrix (IMatrix) – The matrix to muliply this matrix by.
- rotate(angle)¶
- Summary:
Adds a rotation transformation (about the origin) to the matrix.
- Remarks:
A rotation by an angle of zero degrees will have no effect.
- Parameters:
angle (float) – The rotation angle to applied, in an anti-clockwise direction.
- rotate_around_point(angle, point)¶
- Summary:
Adds a rotation transformation (about the specified point) to the matrix.
- Remarks:
Introduced in Impact 8.0.0.49
- Parameters:
angle (float) – The rotation angle to applied, in an anti-clockwise direction.
point (IVector) – The point about which to rotate.
- scale(scale)¶
- Summary:
Adds a scaling transformation (about the origin) to the matrix.
- Remarks:
A scale factor of 1 will have no effect. A scale factor of 0 will produce a singular or degenerate matrix.
- Parameters:
scale (float) – The scale factor for the transformation.
- scale_from_point(scale, point)¶
- Summary:
Adds a scaling transformation (about the specified point) to the matrix.
- Remarks:
Introduced in Impact 8.0.0.49
- Parameters:
scale (float) – The scale factor for the transformation.
point (IVector) – The point about which to scale.
- shift(shift)¶
- Summary:
Adds a shifting transformation to the matrix.
- Remarks:
A shift by (0, 0) will have no effect.
- Parameters:
shift (IVector) – The vector representing the shift, the amount to move in the x and y directions.
- to_string()¶
- Summary:
Returns a string representation of the matrix.
Examples