→ dotspace
Do vector math in JavaScript.
Install
This package is ESM only. Its contents must be import
ed.
npm:
npm install dotspace
yarn:
yarn add dotspace
Usage
When using dotspace all vectors are represented by arrays of numbers:
const newVector = add([1, 0], [0, 1]); // => [1, 1]
This package exports:
- equals
- add
- subtract
- dotProduct
- crossProduct
- magnitude
- resize
- normalize
- multiplyByComponents
- multiplyByScalar
- invert
There are no default exports.