npm install @decoy9697/vector
This library defines a Vector as a tuple with 2 floats: [number, number]
It exposes the following functions for working with these vectors:
| Name | Type |
|---|---|
| add | (Vector, Vector) => Vector |
| cross | (Vector, Vector) => number |
| degreesToVector | (number) => Vector |
| distance | (Vector, Vector) => number |
| dot | (Vector, Vector) => number |
| length | (Vector) => number |
| multiply | (Vector, number) => Vector |
| normalise | (Vector) => Vector |
| radiansToVector | (number) => Vector |
| subtract | (Vector, Vector) => Vector |
| vectorToRadians | (Vector) => number |
This project uses nix to install dependencies for the development shell.
nix-shell - starts a development shell with system dependencies
yarn - install project dependencies
yarn test - run the tests
yarn format - run the linter