Companion

external object Companion : Packable<Matrix2> (source)

Properties

Link copied to clipboard
external val COLUMN0ROW0: Double

The index into Matrix2 for column 0, row 0.

Link copied to clipboard
external val COLUMN0ROW1: Double

The index into Matrix2 for column 0, row 1.

Link copied to clipboard
external val COLUMN1ROW0: Double

The index into Matrix2 for column 1, row 0.

Link copied to clipboard
external val COLUMN1ROW1: Double

The index into Matrix2 for column 1, row 1.

Link copied to clipboard
external val IDENTITY: Matrix2

An immutable Matrix2 instance initialized to the identity matrix.

Link copied to clipboard
open external override val packedLength: Int

The number of elements used to pack the object into an array.

Link copied to clipboard
external val ZERO: Matrix2

An immutable Matrix2 instance initialized to the zero matrix.

Functions

Link copied to clipboard
external fun abs(matrix: Matrix2, result: Matrix2): Matrix2

Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.

Link copied to clipboard
external fun add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2

Computes the sum of two matrices.

Link copied to clipboard
external fun clone(matrix: Matrix2, result: Matrix2? = definedExternally): Matrix2

Duplicates a Matrix2 instance.

Link copied to clipboard
external fun equals(left: Matrix2? = definedExternally, right: Matrix2? = definedExternally): Boolean

Compares the provided matrices componentwise and returns true if they are equal, false otherwise.

Link copied to clipboard
external fun equalsEpsilon(left: Matrix2? = definedExternally, right: Matrix2? = definedExternally, epsilon: Double? = definedExternally): Boolean

Compares the provided matrices componentwise and returns true if they are within the provided epsilon, false otherwise.

Link copied to clipboard
external fun fromArray(array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally, result: Matrix2? = definedExternally): Matrix2

Creates a Matrix2 from 4 consecutive elements in an array.

Link copied to clipboard
external fun fromColumnMajorArray(values: ReadonlyArray<JsDouble>, result: Matrix2? = definedExternally): Matrix2

Creates a Matrix2 instance from a column-major order array.

Link copied to clipboard
external fun fromRotation(angle: Double, result: Matrix2? = definedExternally): Matrix2

Creates a rotation matrix.

Link copied to clipboard
external fun fromRowMajorArray(values: ReadonlyArray<JsDouble>, result: Matrix2? = definedExternally): Matrix2

Creates a Matrix2 instance from a row-major order array. The resulting matrix will be in column-major order.

Link copied to clipboard
external fun fromScale(scale: Cartesian2, result: Matrix2? = definedExternally): Matrix2

Computes a Matrix2 instance representing a non-uniform scale.

Link copied to clipboard
external fun fromUniformScale(scale: Double, result: Matrix2? = definedExternally): Matrix2

Computes a Matrix2 instance representing a uniform scale.

Link copied to clipboard
external fun getColumn(matrix: Matrix2, index: Int, result: Cartesian2): Cartesian2

Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.

Link copied to clipboard
external fun getElementIndex(row: Int, column: Int): Int

Computes the array index of the element at the provided row and column.

Link copied to clipboard
external fun getMaximumScale(matrix: Matrix2): Double

Computes the maximum scale assuming the matrix is an affine transformation. The maximum scale is the maximum length of the column vectors.

Link copied to clipboard
external fun getRotation(matrix: Matrix2, result: Matrix2): Matrix2

Extracts the rotation matrix assuming the matrix is an affine transformation.

Link copied to clipboard
external fun getRow(matrix: Matrix2, index: Int, result: Cartesian2): Cartesian2

Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.

Link copied to clipboard
external fun getScale(matrix: Matrix2, result: Cartesian2): Cartesian2

Extracts the non-uniform scale assuming the matrix is an affine transformation.

Link copied to clipboard
external fun multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2

Computes the product of two matrices.

Link copied to clipboard
external fun multiplyByScalar(matrix: Matrix2, scalar: Double, result: Matrix2): Matrix2

Computes the product of a matrix and a scalar.

Link copied to clipboard
external fun multiplyByScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2

Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.

Link copied to clipboard
external fun multiplyByUniformScale(matrix: Matrix2, scale: Double, result: Matrix2): Matrix2

Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.

Link copied to clipboard
external fun multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2

Computes the product of a matrix and a column vector.

Link copied to clipboard
external fun negate(matrix: Matrix2, result: Matrix2): Matrix2

Creates a negated copy of the provided matrix.

Link copied to clipboard
open external override fun pack(value: Matrix2, array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally): ReadonlyArray<JsDouble>

Stores the provided instance into the provided array.

Link copied to clipboard
external fun packArray(array: ReadonlyArray<Matrix2>, result: ReadonlyArray<JsDouble>? = definedExternally): ReadonlyArray<JsDouble>

Flattens an array of Matrix2s into an array of components. The components are stored in column-major order.

Link copied to clipboard
external fun setColumn(matrix: Matrix2, index: Int, cartesian: Cartesian2, result: Matrix2): Matrix2

Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.

Link copied to clipboard
external fun setRotation(matrix: Matrix2, rotation: Matrix2, result: Matrix2): Matrix2

Sets the rotation assuming the matrix is an affine transformation.

Link copied to clipboard
external fun setRow(matrix: Matrix2, index: Int, cartesian: Cartesian2, result: Matrix2): Matrix2

Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.

Link copied to clipboard
external fun setScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2

Computes a new matrix that replaces the scale with the provided scale. This assumes the matrix is an affine transformation.

Link copied to clipboard
external fun setUniformScale(matrix: Matrix2, scale: Double, result: Matrix2): Matrix2

Computes a new matrix that replaces the scale with the provided uniform scale. This assumes the matrix is an affine transformation.

Link copied to clipboard
external fun subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2

Computes the difference of two matrices.

Link copied to clipboard
external fun toArray(matrix: Matrix2, result: ReadonlyArray<JsDouble>? = definedExternally): ReadonlyArray<JsDouble>

Creates an Array from the provided Matrix2 instance. The array will be in column-major order.

Link copied to clipboard
external fun transpose(matrix: Matrix2, result: Matrix2): Matrix2

Computes the transpose of the provided matrix.

Link copied to clipboard
open external override fun unpack(array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally, result: Matrix2? = definedExternally): Matrix2

Retrieves an instance from a packed array.

Link copied to clipboard
external fun unpackArray(array: ReadonlyArray<JsDouble>, result: ReadonlyArray<Matrix2>? = definedExternally): ReadonlyArray<Matrix2>

Unpacks an array of column-major matrix components into an array of Matrix2s.