Matrix33

Immutable 3x3 Matrix.

Constructor

new Matrix33(values)

Parameters:
NameTypeDescription
valuesArray.<number>

Row-major ordered 9 values.

Classes

Matrix33

Methods

asOneAndZeros() → {Matrix33}

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

Returns:

The simplified matrix.

Type: 
Matrix33

equals(rhs, popt) → {boolean}

Check for Matrix33 equality.

Parameters:
NameTypeAttributesDescription
rhsMatrix33

The other matrix to compare to.

pnumber<optional>

A numeric expression for the precision to use in check (ex: 0.001). Defaults to Number.EPSILON if not provided.

Returns:

True if both matrices are equal.

Type: 
boolean

get(row, col) → {number|undefined}

Get a value of the matrix.

Parameters:
NameTypeDescription
rownumber

The row at wich to get the value.

colnumber

The column at wich to get the value.

Returns:

The value at the position.

Type: 
number | undefined

getAbs() → {Matrix33}

Get the absolute value of this matrix.

Returns:

The result matrix.

Type: 
Matrix33

getColAbsMax(col) → {object}

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

Parameters:
NameTypeDescription
colnumber

The column to get the maximum from.

Returns:

The {value,index} of the maximum.

Type: 
object

getInverse() → {Matrix33|undefined}

Get the inverse of this matrix.

Returns:

The inverse matrix or undefined if the determinant is zero.

Type: 
Matrix33 | undefined

getRowAbsMax(row) → {object}

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

Parameters:
NameTypeDescription
rownumber

The row to get the maximum from.

Returns:

The {value,index} of the maximum.

Type: 
object

getThirdColMajorDirection() → {number}

Get the third column direction index of an orientation matrix.

Returns:

The index of the absolute maximum of the last column.

Type: 
number

multiply(rhs) → {Matrix33}

Multiply this matrix by another.

Parameters:
NameTypeDescription
rhsMatrix33

The matrix to multiply by.

Returns:

The product matrix.

Type: 
Matrix33

multiplyArray3D(array3D) → {Array.<number>}

Multiply this matrix by a 3D array.

Parameters:
NameTypeDescription
array3DArray.<number>

The input 3D array.

Returns:

The result 3D array.

Type: 
Array.<number>

multiplyIndex3D(index3D) → {Index}

Multiply this matrix by a 3D index.

Parameters:
NameTypeDescription
index3DIndex

The input 3D index.

Returns:

The result 3D index.

Type: 
Index

multiplyPoint3D(point3D) → {Point3D}

Multiply this matrix by a 3D point.

Parameters:
NameTypeDescription
point3DPoint3D

The input 3D point.

Returns:

The result 3D point.

Type: 
Point3D

multiplyVector3D(vector3D) → {Vector3D}

Multiply this matrix by a 3D vector.

Parameters:
NameTypeDescription
vector3DVector3D

The input 3D vector.

Returns:

The result 3D vector.

Type: 
Vector3D

toString() → {string}

Get a string representation of the Matrix33.

Returns:

The matrix as a string.

Type: 
string