npm.io
1.4.0 • Published 3 years ago

dotspace

Licence
MIT
Version
1.4.0
Deps
0
Size
21 kB
Vulns
0
Weekly
0

→ dotspace

Do vector math in JavaScript.

Install

This package is ESM only. Its contents must be imported.

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.