Matrix3D
12 Sep 20256 minutes to read
Represents a 3x3 or 4x4 matrix in 3D space and provides various matrix operations.
Methods
createArray
Creates a new array with zeros.
| Parameter | Type | Description | 
|---|---|---|
| initialSize | number | 
      The size of the array. | 
Returns number[]
getDeterminant
Gets the determinant of a matrix.
| Parameter | Type | Description | 
|---|---|---|
| matrix | number[][] | 
      The matrix. | 
Returns number
getIdentity
Gets the identity matrix.
Returns number[][]
getInterval
Gets the interval of a matrix.
| Parameter | Type | Description | 
|---|---|---|
| matrix | number[][] | 
      The matrix to get the interval for. | 
Returns number[][]
getMatrix
Gets a submatrix of a matrix.
| Parameter | Type | Description | 
|---|---|---|
| matrix | number[][] | 
      The matrix. | 
| columnIndex | number | 
      The column index. | 
| rowIndex | number | 
      The row index. | 
Returns number[][]
getMatrixMultiple
Multiplies all elements of a matrix by a factor.
| Parameter | Type | Description | 
|---|---|---|
| factor | number | 
      The factor to multiply with. | 
| matrix | number[][] | 
      The matrix to multiply. | 
Returns number[][]
getMatrixMultiplication
Multiplies two matrices.
| Parameter | Type | Description | 
|---|---|---|
| matrix1 | number[][] | 
      The first matrix. | 
| matrix2 | number[][] | 
      The second matrix. | 
Returns number[][]
getMatrixVectorAnd
Multiplies a matrix by a vector and applies translation.
| Parameter | Type | Description | 
|---|---|---|
| matrix | number[][] | 
      The matrix. | 
| vector (optional) | Chart3DVector | 
      The vector to multiply with. | 
Returns Object
getMatrixVectorMultiple
Multiplies a matrix by a vector.
| Parameter | Type | Description | 
|---|---|---|
| matrix | number[][] | 
      The matrix. | 
| point | Chart3DVector | 
      The vector to multiply with. | 
Returns Chart3DVector
isAffine
Checks if a matrix is an affine matrix.
| Parameter | Type | Description | 
|---|---|---|
| matrixData | number[][] | 
      The matrix to check. | 
Returns boolean
matrix3D
Creates a 3D matrix with the specified size.
| Parameter | Type | Description | 
|---|---|---|
| size | number | 
      The size of the matrix. | 
Returns number[][]
tilt
Creates a matrix for rotation around the x-axis.
| Parameter | Type | Description | 
|---|---|---|
| angle | number | 
      The angle of rotation. | 
Returns number[][]
transform
Transforms a matrix by translation.
| Parameter | Type | Description | 
|---|---|---|
| x | number | 
      The x-coordinate of the translation. | 
| y | number | 
      The y-coordinate of the translation. | 
| z | number | 
      The z-coordinate of the translation. | 
Returns number[][]
transposed
Transposes a matrix.
| Parameter | Type | Description | 
|---|---|---|
| matrix3D | number[][] | 
      The matrix to transpose. | 
Returns number[][]
turn
Creates a matrix for rotation around the y-axis.
| Parameter | Type | Description | 
|---|---|---|
| angle | number | 
      The angle of rotation. | 
Returns number[][]