Matrix
Class defining a simple 4x4 matrix where x,y,z is stored in the last colomn:
Quick Facts
| Property | Value |
|---|---|
| Class | Matrix |
| Module | cenpymath.Matrix |
| Package | cenpymath |
| Release | R2025.2.4 |
| Methods | 7 |
Quick Start
# Boilerplate Example
obj = Matrix([])
result = obj.GetPosition()Method Index
| Method | Returns | Summary |
|---|---|---|
__init__ | None | Constructor |
GetPosition | Point3D.Point3D | Gets the position part of the matrix |
GetOrientation | tuple | Gets the Rotation angles as Euler angles in notation XYZs |
SetArray | None | Sets the matrix array. |
GetArray | list | Gets the array of this 4x4 matrix |
SetPosition | None | Sets the position for this matrix |
SetOrientation | None | Sets the orientation for this matrix. |
Lifecycle
__init__
def __init__(array: list=None) -> NoneConstructor
This will create a unit matrix
Parameters:
| Name | Type | Description |
|---|---|---|
array | list | — (default: None) |
Returns: None
Query Methods
GetPosition
def GetPosition() -> Point3D.Point3DGets the position part of the matrix
Returns: Point3D.Point3D — returns position as Point3D
GetOrientation
def GetOrientation() -> tupleGets the Rotation angles as Euler angles in notation XYZs
Returns: tuple — rotation angles as tuple with (rotX, rotY, rotZ)
GetArray
def GetArray() -> listGets the array of this 4x4 matrix
Returns: list — returns the array as list of float
Mutation Methods
SetArray
def SetArray(array: list) -> NoneSets the matrix array. The array most be provided as: a1 b1 c1 x a2 b2 c2 y a3 b3 c3 z 0.0 0.0 0.0 1.0
Parameters:
| Name | Type | Description |
|---|---|---|
array | list | new array to set (length must be 16) |
Returns: None
SetPosition
def SetPosition(xyz: Point3D.Point3D) -> NoneSets the position for this matrix
Parameters:
| Name | Type | Description |
|---|---|---|
xyz | Point3D.Point3D | new matrix position |
Returns: None
SetOrientation
def SetOrientation(rpy: tuple) -> NoneSets the orientation for this matrix. Values given as roll, pitch, yaw (rotX, rotY, rotZ)
Parameters:
| Name | Type | Description |
|---|---|---|
rpy | tuple | new matrix orientation in roll, pitch, yaw |
Returns: None
Version Notes
This class is documented as of release R2025.2.4.