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.Matrix2x3d class

2x3 double matrix

Static methods

def from_diagonal(diagonal: Vector2d) -> Matrix2x3d
Construct a diagonal matrix
def zero_init() -> Matrix2x3d
Construct a zero-filled matrix

Methods

def diagonal(self, /) -> Vector2d
Values on diagonal
def flipped_cols(self, /) -> Matrix2x3d
Matrix with flipped cols
def flipped_rows(self, /) -> Matrix2x3d
Matrix with flipped rows
def transposed(self, /) -> Matrix3x2d
Transposed matrix

Special methods

def __add__(self, arg0: Matrix2x3d, /) -> Matrix2x3d
Add a matrix
def __eq__(self, arg0: Matrix2x3d, /) -> bool
Equality comparison
def __getitem__(self, arg0: int, /) -> Vector3d
Column at given position
def __getitem__(self, arg0: typing.Tuple[int, int], /) -> float
Value at given col/row
def __getstate__(self, /) -> bytes
Dumps the in-memory representation of matrix components
def __iadd__(self, arg0: Matrix2x3d, /) -> Matrix2x3d
Add and assign a matrix
def __imul__(self, arg0: float, /) -> Matrix2x3d
Multiply with a scalar and assign
def __init__(self, arg0: Matrix2x3, /) -> 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: Vector3d, arg1: Vector3d, /) -> None
Construct from column vectors
def __init__(self, arg0: typing.Tuple[Vector3d, Vector3d], /) -> None
Construct from a column vector tuple
def __init__(self, arg0: typing.Tuple[typing.Tuple[float, float, float], typing.Tuple[float, float, float]], /) -> None
Construct from a column tuple
def __isub__(self, arg0: Matrix2x3d, /) -> Matrix2x3d
Subtract and assign a matrix
def __itruediv__(self, arg0: float, /) -> Matrix2x3d
Divide with a scalar and assign
def __len__() -> int
Matrix column count. Returns 2.
def __matmul__(self, arg0: Matrix2x2d, /) -> Matrix2x3d
Multiply a matrix
def __matmul__(self, arg0: Matrix3x2d, /) -> Matrix3x3d
Multiply a matrix
def __matmul__(self, arg0: Matrix4x2d, /) -> Matrix4x3d
Multiply a matrix
def __mul__(self, arg0: float, /) -> Matrix2x3d
Multiply with a scalar
def __mul__(self, arg0: Vector2d, /) -> Vector3d
Multiply a vector
def __ne__(self, arg0: Matrix2x3d, /) -> bool
Non-equality comparison
def __neg__(self, /) -> Matrix2x3d
Negated matrix
def __repr__(self, /) -> str
Object representation
def __rmul__(self, arg0: float, /) -> Matrix2x3d
Multiply a scalar with a matrix
def __rtruediv__(self, arg0: float, /) -> Matrix2x3d
Divide a matrix with a scalar and invert
def __setitem__(self, arg0: int, arg1: Vector3d, /) -> 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 __setstate__(self, arg0: bytes, /) -> None
Treats the data as the in-memory representation of matrix components
def __sub__(self, arg0: Matrix2x3d, /) -> Matrix2x3d
Subtract a matrix
def __truediv__(self, arg0: float, /) -> Matrix2x3d
Divide with a scalar

Method documentation

def magnum.Matrix2x3d.__setstate__(self, arg0: bytes, /) -> None

Treats the data as the in-memory representation of matrix components

Exceptions
ValueError If the data size doesn’t match type size