EndGate.Matrix2x2

Description: Defines a matrix with 2 columns and 2 rows (2x2).

Implements: EndGate.ICloneable

Constructors

Matrix2x2 ()
Creates a new instance of Matrix2x2 with all rows and columns initialized to 0.

Matrix2x2 (topLeft, topRight, botLeft, botRight)
Creates a new instance of Matrix2x2.

topLeft: number
The row 0 column 0 initial value.

topRight: number
The row 0 column 1 initial value.

botLeft: number
The row 1 column 0 initial value.

botRight: number
The row 1 column 1 initial value.

Fields

Values: number[][]
Gets or sets the matrix values. Represents the current Matrix2x2 as a multi-dimensional array.

(Static) Zero: Matrix2x2
Creates a Matrix2x2 with all its rows and columns initialized to 0.

(Static) Identity: Matrix2x2
Returns the identity matrix for a 2x2.

Methods

Apply()
Executes the action with each row and column item of this Matrix2x2 and modifies their values.

Trigger()
Executes the action with each row and column item of this Matrix2x2.

Add()
Returns a Matrix2x2 that is the result of adding the current Matrix2x2 to the provided Matrix2x2.

Multiply()
Returns a Matrix2x2 that is the result of multiplying the current Matrix2x2 by the provided Matrix2x2.

Subtract()
Returns a Matrix2x2 that is the result of subtracting the current Matrix2x2 by the provided Matrix2x2.

SubtractFrom()
Returns a Matrix2x2 that is the result of subtracting the current Matrix2x2 from the provided Matrix2x2.

Divide()
Returns a Matrix2x2 that is the result of dividing the current Matrix2x2 by the provided Matrix2x2.

DivideFrom()
Returns a Matrix2x2 that is the result of dividing the current Matrix2x2 from the provided Matrix2x2.

Transform()
Returns a Vector2d that has been transformed by the current Matrix2x2.

Transpose()
Returns the transpose of the current Matrix2x2.

Determinant()
Returns the determinant of the current Matrix2x2.

Inverse()
Returns the inverse of the current Matrix2x2.

Clone()
Returns a Matrix2x2 that has identical rows and columns as the current Matrix2x2.

Equivalent()
Determines whether this Matrix2x2 has the same row and column values as the provided Matrix2x2.

toString()
Overridden toString method to display Matrix2x2 in easy to read format: "[topLeft, topRight] [botLeft, botRight]"

(Static) Scale()
Creates a scaling matrix based off the provided Vector2d.

Examples

There's currently no example available for this page. If you'd like to suggest one send me an containing a description, code, and link to the page for the suggested example. As a thanks I'll associate the code snippet with your name directly below the example if approved.