Options
All
• Public
• Public/Protected
• All

Class Matrix2D

Class used to provide 2D matrix features

• Matrix2D

Constructors

• new Matrix2D(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D
• Creates a new matrix

Parameters

• m00: number

defines value for (0, 0)

• m01: number

defines value for (0, 1)

• m10: number

defines value for (1, 0)

• m11: number

defines value for (1, 1)

• m20: number

defines value for (2, 0)

• m21: number

defines value for (2, 1)

Properties

m: Float32Array

Gets the internal array of 6 floats used to store matrix data

Methods

• determinant(): number
• Gets matrix determinant

Returns number

the determinant

• fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D
• Fills the matrix from direct values

Parameters

• m00: number

defines value for (0, 0)

• m01: number

defines value for (0, 1)

• m10: number

defines value for (1, 0)

• m11: number

defines value for (1, 1)

• m20: number

defines value for (2, 0)

• m21: number

defines value for (2, 1)

Returns Matrix2D

the current modified matrix

• Inverses the matrix and stores it in a target matrix

Parameters

• result: Matrix2D

defines the target matrix

Returns Matrix2D

the current matrix

• Multiplies the current matrix with another one

Parameters

• other: Matrix2D

defines the second operand

• result: Matrix2D

defines the target matrix

Returns Matrix2D

the current matrix

• Applies the current matrix to a set of 2 floats and stores the result in a vector2

Parameters

• x: number

defines the x coordinate to transform

• y: number

defines the x coordinate to transform

• result: Vector2

defines the target vector2

Returns Matrix2D

the current matrix

• ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void
• Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix

Parameters

• tx: number

defines the x coordinate of the translation

• ty: number

defines the y coordinate of the translation

• angle: number

defines the rotation angle

• scaleX: number

defines the x coordinate of the scaling

• scaleY: number

defines the y coordinate of the scaling

• parentMatrix: Nullable<Matrix2D>

defines the parent matrix to multiply by (can be null)

• result: Matrix2D

defines the target matrix

Returns void

• Creates an identity matrix

Returns Matrix2D

a new matrix

• Creates an identity matrix and stores it in a target matrix

Parameters

• result: Matrix2D

defines the target matrix

Returns void

• RotationToRef(angle: number, result: Matrix2D): void
• Creates a rotation matrix and stores it in a target matrix

Parameters

• angle: number

defines the rotation angle

• result: Matrix2D

defines the target matrix

Returns void

• ScalingToRef(x: number, y: number, result: Matrix2D): void
• Creates a scaling matrix and stores it in a target matrix

Parameters

• x: number

defines the x coordinate of the scaling

• y: number

defines the y coordinate of the scaling

• result: Matrix2D

defines the target matrix

Returns void

• TranslationToRef(x: number, y: number, result: Matrix2D): void
• Creates a translation matrix and stores it in a target matrix

Parameters

• x: number

defines the x coordinate of the translation

• y: number

defines the y coordinate of the translation

• result: Matrix2D

defines the target matrix

Legend

• Constructor
• Property
• Method
• Inherited constructor
• Inherited property
• Inherited method
• Property
• Method
• Static method

Theme