@rawify/vector3
Version:
The RAW JavaScript 3D Vector library
45 lines (33 loc) • 1.01 kB
Markdown
`Matrix
**This methods modifies the current Matrix object.**
`
1. The number of columns on the original matrix does not equal the number of rows on the matrix passed, as the multiplication is impossible.
2. The argument passed is not a valid Matrix object.
```javascript
// Create a couple new Matrix objects
var m1 = new Matrix([
[],
[],
[]
]);
var m2 = new Matrix([
[],
[]
]);
// #multiply() will multiply two matrices
m1.multiply(m2);
// #multiply() also accepts a two-dimensional array
m1.multiply([
[],
[]
]);
// will throw an error if the argument passed is not a valid Matrix object
m1.multiply('hi');
// => Throws an error
// will throw an error if the dimensions are invalid
m1.multiply(new Matrix(5, 5));
// => Throws an error
```