new Matrix(m)
Constructor for Matrix
Parameters:
| Name | Type | Description |
|---|---|---|
m |
? | Setup with this matrix. Otherwise, ident |
Methods
(static) matMult(m1, m2, destopt) → {Object}
Static method to allow matrix multiplication
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
m1 |
Object | The first matrix | |
m2 |
Object | The second matrix | |
dest |
Object |
<optional> |
destination matrix |
Returns:
dest the multiplied matrix
- Type
- Object
inverse(Theopt) → {dest}
Get the inverse of one matrix into another matrix
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
The |
dest |
<optional> |
destination of the matrix inverse |
Returns:
The matrix inverse
- Type
- dest
inverseSelf() → {bool}
Get the inverse of matrix (in place)
Returns:
inverted Whether or not the inverse could be taken
- Type
- bool
loadIdent()
Set this matrix to identity
multSelf(m2)
Multiply this matrix with another
Parameters:
| Name | Type | Description |
|---|---|---|
m2 |
Object | matrix to multiply with |
rotateSelf(r)
rotate this matrix
Parameters:
| Name | Type | Description |
|---|---|---|
r |
number |
scaleSelf(x, y)
Scale this matrix
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | |
y |
number |
set(m)
Set this matrix with an array of arrays
Parameters:
| Name | Type | Description |
|---|---|---|
m |
? | become this matrix |
transformPoint(popt, destopt) → {Object}
Transform a point by this matrix
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
p |
Object |
<optional> |
point object |
dest |
Object |
<optional> |
point object |
Returns:
point The transformed point
- Type
- Object
transformPointSelf(popt)
Transform a point in place by this matrix
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
p |
Object |
<optional> |
point object |
translateSelf(x, y)
transform this matrix
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | |
y |
number |