@rawify/vector3
Version:
The RAW JavaScript 3D Vector library
36 lines (25 loc) • 863 B
Markdown
`Matrix
**This method modifies the current Matrix object.**
`
```javascript
// Create a new Matrix object
var m1 = new Matrix(2, 2);
// #subtract() accepts a two-dimensional array
m1.subtract([
[],
[]
]);
// #subtract() also accepts a Matrix object
var m2 = new Matrix([
[],
[]
]);
m1.subtract(m2);
// #subtract() accepts multiple parameters
m1.subtract(m2, [[4,3],[2,1]]);
// This will throw an error because the matrix to subtract has different dimensions
m1.subtract(new Matrix(3, 3));
```