Skip to Content

Matrix

Class defining a simple 4x4 matrix where x,y,z is stored in the last colomn:

Quick Facts

PropertyValue
ClassMatrix
Modulecenpymath.Matrix
Packagecenpymath
ReleaseR2025.2.4
Methods7

Quick Start

# Boilerplate Example obj = Matrix([]) result = obj.GetPosition()

Method Index

MethodReturnsSummary
__init__NoneConstructor
GetPositionPoint3D.Point3DGets the position part of the matrix
GetOrientationtupleGets the Rotation angles as Euler angles in notation XYZs
SetArrayNoneSets the matrix array.
GetArraylistGets the array of this 4x4 matrix
SetPositionNoneSets the position for this matrix
SetOrientationNoneSets the orientation for this matrix.

Lifecycle

__init__

def __init__(array: list=None) -> None

Constructor

This will create a unit matrix

Parameters:

NameTypeDescription
arraylist— (default: None)

Returns: None

Query Methods

GetPosition

def GetPosition() -> Point3D.Point3D

Gets the position part of the matrix

Returns: Point3D.Point3D — returns position as Point3D

GetOrientation

def GetOrientation() -> tuple

Gets the Rotation angles as Euler angles in notation XYZs

Returns: tuple — rotation angles as tuple with (rotX, rotY, rotZ)

GetArray

def GetArray() -> list

Gets the array of this 4x4 matrix

Returns: list — returns the array as list of float

Mutation Methods

SetArray

def SetArray(array: list) -> None

Sets 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:

NameTypeDescription
arraylistnew array to set (length must be 16)

Returns: None

SetPosition

def SetPosition(xyz: Point3D.Point3D) -> None

Sets the position for this matrix

Parameters:

NameTypeDescription
xyzPoint3D.Point3Dnew matrix position

Returns: None

SetOrientation

def SetOrientation(rpy: tuple) -> None

Sets the orientation for this matrix. Values given as roll, pitch, yaw (rotX, rotY, rotZ)

Parameters:

NameTypeDescription
rpytuplenew matrix orientation in roll, pitch, yaw

Returns: None

Version Notes

This class is documented as of release R2025.2.4.

Was this page helpful?