class M44d

4x4 double precision floating point transformation matrix. Matrices are multiplied from left to right, i-e, a world matrix would be computed like this : world = local*parent_world.

M44d()

Default constructor: initialize to identity

1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
M44d(a: double)

Initialize to scalar constant

a a a a
a a a a
a a a a
a a a a
M44d(a: double, b: double, c: double, d: double, e: double, f: double, g: double, h: double, i: double, j: double, k: double, l: double, m: double, n: double, o: double, p: double)

Construct from given scalar values:

a b c d
e f g h
i j k l
m n o p
M44d(r: M33d, t: V3d)

Construct from a 3x3 rotation matrix and a translation vector

r r r 0
r r r 0
r r r 0
t t t 1
__getitem__(i: int) V4d

Return the i-th row.

__eq__(o: M44d) bool

Return True if both matrix are equal.

__neq__(o: M44d) bool

Return True if both matrix are not equal.

__mul__(o: M44d) M44d

Matrix-matrix multiplication

__mul__(a: double) M44d

Component-wise multiplication

__truediv__(a: double) M44d

Component-wise division

__add__(o: M44d) M44d

Component-wise addition

__sub__(o: M44d) M44d

Component-wise subtraction

__neg__() M44d

Component-wise multiplication by -1

determinant() double

Determinant

equalWithAbsError(m: M44d, e: double) 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: M44d, e: double) 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) double

Build a minor using the specified rows and columns

gjInverse() M44d

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() M44d

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) double

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

multVecMatrix(v: V3d) V3d

Transform the point v by the matrix

multDirMatrix(v: V3d) V3d

Transform the vector v by the matrix

rotate(r: V3d)

Rotate the matrix by XYZ euler angles in r (in radians)

scale(s: V3d)

Scale the matrix by s

shear(h: V3d)

Set matrix to shear by given vector h. The resulting matrix

  • will shear x for each y coord. by a factor of h[0] ;

  • will shear x for each z coord. by a factor of h[1] ;

  • will shear y for each z coord. by a factor of h[2] .

setAxisAngle(r: V3d)

Set matrix to rotation around given axis by given angle (in radians)

setEulerAngles(r: V3d)

Set matrix to rotation by XYZ euler angles (in radians)

setScale(s: double)

Set matrix to scale by given uniform factor

setScale(r: V3d)

Set matrix to scale by given vector

setShear(h: V3d)

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: V3d)

Set matrix to translation by given vector

transpose()

Transpose

translate(t: V3d)

Translate the matrix by t

translation() V3d

Return translation component

transposed() M44d

Return the transpose