dotspace
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

→ 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.

/dotspace/

    Package Sidebar

    Install

    npm i dotspace

    Weekly Downloads

    2

    Version

    1.4.0

    License

    MIT

    Unpacked Size

    21.3 kB

    Total Files

    8

    Last publish

    Collaborators

    • bakkerjoeri