Matrix2

Matrix2

2x2 matrices Following Three.js, elements are stored in a column major system

Constructor

new Matrix2()

Source:

Constructor Return the identity matrix

Classes

Matrix2

Methods

clone() → {Matrix2}

Source:

Return a copy of the current matrix

Returns:
  • the duplicated matrix
Type
Matrix2

copy(m) → {Matrix2}

Source:

Copy the given matrix into the current matrix

Parameters:
Name Type Description
m Matrix2

the matrix to copy

Returns:
  • the current matrix
Type
Matrix2

determinant() → {number}

Source:

Return the determinant of the current matrix

Returns:
  • the determinant
Type
number

equals(m) → {boolean}

Source:

Check if the matrix equals the current matrix

Parameters:
Name Type Description
m Matrix2

the matrix to test again

Returns:
  • true if the matrices are the same, false otherwise
Type
boolean

identity() → {Matrix2}

Source:

Set the current matrix to the identity

Returns:
  • the identity matrix
Type
Matrix2

invert() → {Matrix2}

Source:

Invert the current matrix

Returns:
  • the inverse of the matrix
Type
Matrix2

multiply(m) → {Matrix2}

Source:

Multiply the current matrix by m on the right (i.e. return this * m)

Parameters:
Name Type Description
m Matrix2

the other matrix

Returns:
  • the product
Type
Matrix2

multplyMatrices(m1, m2)

Source:

Multiply the given matrices Return the product m1 * m2

Parameters:
Name Type Description
m1 Matrix2

the first matrix

m2 Matrix2

the second matrix

power(n) → {Matrix2}

Source:

Return the given power of the current matrix

Parameters:
Name Type Description
n number

the exponent. It should be an integer (non necessarily positive)

Returns:
  • the power of the matrix
Type
Matrix2

premultiply(m) → {Matrix2}

Source:

Multiply the current matrix by m on the left (i.e. return m * this)

Parameters:
Name Type Description
m Matrix2

the other matrix

Returns:
  • the product
Type
Matrix2

set(a, b, c, d) → {Matrix2}

Source:

Set the coefficients of the matrix

Parameters:
Name Type Description
a number

(0,0)-entry

b number

(0,1)-entry

c number

(1,0)-entry

d number

(1,1)-entry

Returns:
  • the current matrix
Type
Matrix2