Skip to content

Mat3X3

Represents a 3×3 matrix of single-precision floating-point values. This datatype is used for 2D/3D linear transforms (e.g. rotation or scaling) within the Telekinesis ecosystem.

Field

Required

FieldTypeDescription
matrixArrayLike3×3 matrix; shape (3, 3), dtype float32.

Optional

None.

Methods

MethodDescription
to_list()Returns a nested Python list of 3 rows × 3 columns (e.g. [[m00, m01, m02], [m10, m11, m12], [m20, m21, m22]]).
to_numpy()Returns a NumPy array of shape (3, 3), dtype float32.

Example

python
import numpy as np
from datatypes import datatypes

# ------------------------------------------------
# 1. Create Mat3X3 instance
# ------------------------------------------------
matrix = np.array([
    [1.0, 0.0, 0.0],
    [0.0, 1.0, 0.0],
    [0.0, 0.0, 1.0],
], dtype=np.float32)
mat_3x3 = datatypes.Mat3X3(matrix)

# ------------------------------------------------
# 2. Access matrix via to_list and to_numpy
# ------------------------------------------------
matrix_list = mat_3x3.to_list()
logger.info("Mat3X3 to_list row0={}", matrix_list[0])
logger.info("Mat3X3 to_list row1={}", matrix_list[1])
logger.info("Mat3X3 to_list row2={}", matrix_list[2])
logger.info("Mat3X3 to_numpy shape={}", mat_3x3.to_numpy().shape)