class M33f

3x3 floating point transformation matrix.

M33f()

Default constructor: initialize to identity

1 0 0
0 1 0
0 0 1
M33f(a: float)

Initialize to scalar constant

a a a
a a a
a a a
M33f(a: float, b: float, c: float, d: float, e: float, f: float, g: float, h: float, i: float)

Construct from given scalar values:

a b c
d e f
g h i
__getitem__(i: int) V3f

Return the i-th row.

__eq__(o: M33f) bool

Return True if both matrix are equal.

__neq__(o: M33f) bool

Return True if both matrix are not equal.

__mul__(o: M33f) M33f

Matrix-matrix multiplication

__mul__(a: float) M33f

Component-wise multiplication

__truediv__(a: float) M33f

Component-wise division

__add__(o: M33f) M33f

Component-wise addition

__sub__(o: M33f) M33f

Component-wise subtraction

__neg__() M33f

Component-wise multiplication by -1

determinant() float

Determinant

equalWithAbsError(m: M33f, e: float) bool

Compare two matrices and test if they are “approximately equal”: @return True if the coefficients of this and m are the same with an absolute error of no more than e, i.e., for all i, j:

abs (this[i][j] - m[i][j]) <= e

equalWithRelError(m: M33f, e: float) bool

Compare two matrices and test if they are “approximately equal”: @return True if the coefficients of this and m are the same with a relative error of no more than e, i.e., for all i, j:

abs (this[i] - v[i][j]) <= e * abs (this[i][j])

fastMinor(r0: int, r1: int, c0: int, c1: int) float

Build a minor using the specified rows and columns

gjInverse() M33f

Return the inverse using the Gauss-Jordan method. Significantly slower, leaving this unmodified. Slower but more accurate than inverse().

gjInvert()

Invert in place using the Gauss-Jordan method. Significantly slower but more accurate than invert().

inverse() M33f

Return the inverse using the determinant, leaving this unmodified.

invert()

Invert in place using the determinant

negate()

Component-wise multiplication by -1

makeIdentity()

Set to the identity matrix

minorOf(r: int, c: int) float

Calculate the matrix minor of the (r,c) element

multVecMatrix(v: V2f) V2f

Transform the point v by the matrix

multDirMatrix(v: V2f) V2f

Transform the vector v by the matrix

rotate(r: float)

Rotate the given matrix by r (in radians)

scale(s: V2f)

Scale the matrix by s

shear(h: V2f)

Shear the matrix in x for each y coord. by given factor xy and shear y for each x coord. by given factor yx

shear(xy: float)

Shear the matrix in x for each y coord. by given factor xy

setScale(s: float)

Set matrix to scale by given uniform factor

setScale(r: V2f)

Set matrix to scale by given vector

setShear(h: V2f)

Set matrix to shear x for each y coord. by given factor h.x and to shear y for each x coord. by given factor h.y

setTranslation(t: V2f)

Set matrix to translation by given vector

transpose()

Transpose

translate(t: V2f)

Translate the matrix by t

translation() V2f

Return translation component

transposed() M33f

Return the transpose