Circular3DMatrix
12 Sep 20254 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[][]
getMatrixVectorMultiple
Multiplies a matrix by a vector.
| Parameter | Type | Description |
|---|---|---|
| matrix | number[][] |
The matrix. |
| point | Circular3DVector |
The vector to multiply with. |
Returns Circular3DVector
isAffine
Checks if a matrix is an affine matrix.
| Parameter | Type | Description |
|---|---|---|
| matrixData | number[][] |
The matrix to check. |
Returns boolean
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[][]