Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

magnum.Matrix4x4 class

4x4 float matrix

Static methods

def from_diagonal(arg0: Vector4, /) -> Matrix4x4
Construct a diagonal matrix
def identity_init(value: float = 1.0) -> Matrix4x4
Construct an identity matrix
def zero_init() -> Matrix4x4
Construct a zero-filled matrix

Methods

def adjugate(self, /) -> Matrix4x4
Adjugate matrix
def cofactor(self, col: int, row: int) -> float
Cofactor
def comatrix(self, /) -> Matrix4x4
Matrix of cofactors
def determinant(self, /) -> float
Determinant
def diagonal(self, /) -> Vector4
Values on diagonal
def flipped_cols(self, /) -> Matrix4x4
Matrix with flipped cols
def flipped_rows(self, /) -> Matrix4x4
Matrix with flipped rows
def inverted(self, /) -> Matrix4x4
Inverted matrix
def inverted_orthogonal(self, /) -> Matrix4x4
Inverted orthogonal matrix
def is_orthogonal(self, /) -> bool
Whether the matrix is orthogonal
def trace(self, /) -> float
Trace of the matrix
def transposed(self, /) -> Matrix4x4
Transposed matrix

Special methods

def __add__(self, arg0: Matrix4x4, /) -> Matrix4x4
Add a matrix
def __eq__(self, arg0: Matrix4x4, /) -> bool
Equality comparison
def __getitem__(self, arg0: int, /) -> Vector4
Column at given position
def __getitem__(self, arg0: typing.Tuple[int, int], /) -> float
Value at given col/row
def __iadd__(self, arg0: Matrix4x4, /) -> Matrix4x4
Add and assign a matrix
def __imul__(self, arg0: float, /) -> Matrix4x4
Multiply with a scalar and assign
def __init__(self, arg0: Matrix4x4d, /) -> None
Construct from different underlying type
def __init__(self, arg0: buffer, /) -> None
Construct from a buffer
def __init__(self, /) -> None
Default constructor
def __init__(self, arg0: float, /) -> None
Construct a matrix with one value for all components
def __init__(self, arg0: Vector4, arg1: Vector4, arg2: Vector4, arg3: Vector4, /) -> None
Construct from column vectors
def __init__(self, arg0: typing.Tuple[Vector4, Vector4, Vector4, Vector4], /) -> None
Construct from a column vector tuple
def __init__(self, arg0: typing.Tuple[typing.Tuple[float, float, float, float], typing.Tuple[float, float, float, float], typing.Tuple[float, float, float, float], typing.Tuple[float, float, float, float]], /) -> None
Construct from a column tuple
def __isub__(self, arg0: Matrix4x4, /) -> Matrix4x4
Subtract and assign a matrix
def __itruediv__(self, arg0: float, /) -> Matrix4x4
Divide with a scalar and assign
def __len__() -> int
Matrix column count. Returns 4.
def __matmul__(self, arg0: Matrix4x4, /) -> Matrix4x4
Multiply a matrix
def __matmul__(self, arg0: Matrix2x4, /) -> Matrix2x4
Multiply a matrix
def __matmul__(self, arg0: Matrix3x4, /) -> Matrix3x4
Multiply a matrix
def __mul__(self, arg0: float, /) -> Matrix4x4
Multiply with a scalar
def __mul__(self, arg0: Vector4, /) -> Vector4
Multiply a vector
def __ne__(self, arg0: Matrix4x4, /) -> bool
Non-equality comparison
def __neg__(self, /) -> Matrix4x4
Negated matrix
def __repr__(self, /) -> str
Object representation
def __rmul__(self, arg0: float, /) -> Matrix4x4
Multiply a scalar with a matrix
def __rtruediv__(self, arg0: float, /) -> Matrix4x4
Divide a matrix with a scalar and invert
def __setitem__(self, arg0: int, arg1: Vector4, /) -> None
Set a column at given position
def __setitem__(self, arg0: typing.Tuple[int, int], arg1: float, /) -> None
Set a value at given col/row
def __sub__(self, arg0: Matrix4x4, /) -> Matrix4x4
Subtract a matrix
def __truediv__(self, arg0: float, /) -> Matrix4x4
Divide with a scalar