DWVv0.37.0

Matrix33

Source: matrix.js:14

Immutable 3x3 Matrix.


Constructor

new Matrix33(values: Array.<number>): Matrix33

Parameters

  • values (Array.<number>) — Row-major ordered 9 values.

Instance Methods

get(row: number, col: number): number | undefined

Get a value of the matrix.

Parameters

  • row (number) — The row at wich to get the value.
  • col (number) — The column at wich to get the value.

Returns

  • number | undefined — The value at the position.

getInverse(): Matrix33 | undefined

Get the inverse of this matrix.

Returns

  • Matrix33 | undefined — The inverse matrix or undefined if the determinant is zero.

equals(rhs: Matrix33): boolean

Check for Matrix33 equality.

Parameters

  • rhs (Matrix33) — The other matrix to compare to.

Returns

  • boolean — True if both matrices are equal.

isSimilar(rhs: Matrix33, tol?: number): boolean

Check for Matrix33 similarity.

Parameters

  • rhs (Matrix33) — The other matrix to compare to.
  • tol (number, optional) — Optional number comparison tolerance, defaults to Number.EPSILON.

Returns

  • boolean — True if both matrices are similar.

toString(): string

Get a string representation of the Matrix33.

Returns

  • string — The matrix as a string.

multiply(rhs: Matrix33): Matrix33

Multiply this matrix by another.

Parameters

  • rhs (Matrix33) — The matrix to multiply by.

Returns

getAbs(): Matrix33

Get the absolute value of this matrix.

Returns

multiplyArray3D(array3D: Array.<number>): Array.<number>

Multiply this matrix by a 3D array.

Parameters

  • array3D (Array.<number>) — The input 3D array.

Returns

  • Array.<number> — The result 3D array.

multiplyTypedArray3D( sourceArray: TypedArray, outArray: TypedArray, )

Multiply this matrix by a 3D typed array.

Parameters

multiplyVector3D(vector3D: Vector3D): Vector3D

Multiply this matrix by a 3D vector.

Parameters

  • vector3D (Vector3D) — The input 3D vector.

Returns

multiplyPoint3D(point3D: Point3D): Point3D

Multiply this matrix by a 3D point.

Parameters

  • point3D (Point3D) — The input 3D point.

Returns

multiplyIndex3D(index3D: Index): Index

Multiply this matrix by a 3D index.

Parameters

  • index3D (Index) — The input 3D index.

Returns

  • Index — The result 3D index.

getRowAbsMax(row: number): object

Get the index of the maximum in absolute value of a row.

Parameters

  • row (number) — The row to get the maximum from.

Returns

  • object — The {value,index} of the maximum.

getColAbsMax(col: number): object

Get the index of the maximum in absolute value of a column.

Parameters

  • col (number) — The column to get the maximum from.

Returns

  • object — The {value,index} of the maximum.

asOneAndZeros(): Matrix33

Get this matrix with only zero and +/- ones instead of the maximum.

Returns

getThirdColMajorDirection(): number

Get the third column direction index of an orientation matrix.

Returns

  • number — The index of the absolute maximum of the last column.

getValues(): Array.<number>

Get the values of the matrix as an array.

Returns

  • Array.<number> — The matrix.