class M22d

2x2 double precision floating point transformation matrix.

M22d()

Default constructor: initialize to identity

1 0
0 1
M22d(a: double)

Initialize to scalar constant

a a
a a
M22d(a: double, b: double, c: double, d: double)

Construct from given scalar values:

a b
c d
__getitem__(i: int) V2d

Return the i-th row.

__eq__(o: M22d) bool

Return True if both matrix are equal.

__neq__(o: M22d) bool

Return True if both matrix are not equal.

__mul__(o: M22d) M22d

Matrix-matrix multiplication

__mul__(a: double) M22d

Component-wise multiplication

__truediv__(a: double) M22d

Component-wise division

__add__(o: M22d) M22d

Component-wise addition

__sub__(o: M22d) M22d

Component-wise subtraction

__neg__() M22d

Component-wise multiplication by -1

determinant() double

Determinant

equalWithAbsError(m: M22d, 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: M22d, 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

inverse() M22d

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

multDirMatrix(v: V2d) V2d

Transform the vector v by the matrix

rotate(r: double)

Rotate the matrix by r (in radians)

scale(s: V2d)

Scale the matrix by s

setRotation(r: double)

Set matrix to rotation by r (in radians)

setScale(s: double)

Set matrix to scale by given uniform factor

setScale(r: V2d)

Set matrix to scale by given vector

transpose()

Transpose

transposed() M22d

Return the transpose