# wtc-vector

> ES6 2D Vector Class

Latest version **0.1.11** (published 2019-07-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install wtc-vector
pnpm add wtc-vector
yarn add wtc-vector
bun add wtc-vector
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2019-07-25 |
| First published | 2016-12-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 80.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Liam Egan |
| Maintainers | wethecollective |
| Keywords | wtc, math, vector, vector2d |

## Links

- npm: https://www.npmjs.com/package/wtc-vector
- Repository: https://github.com/wethegit/wtc-vector
- Homepage: https://github.com/wethegit/wtc-vector#readme
- Issues: https://github.com/wethegit/wtc-vector/issues
- npm.io page: https://npm.io/package/wtc-vector

## Dependencies (1)

- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.4.4

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.1.11 (latest) — 2019-07-25
- 0.1.10 — 2019-07-25
- 0.1.9 — 2019-02-05
- 0.1.8 — 2019-01-30
- 0.1.7 — 2018-04-23
- 0.1.6 — 2018-04-23
- 0.1.5 — 2017-06-14
- 0.1.4 — 2017-03-16
- 0.1.3 — 2017-02-15
- 0.1.2 — 2017-01-04
- 0.1.1 — 2016-12-19
- 0.1.0 — 2016-12-17

## README

# wtc-vector
A basic 2d vector class.

## Usage
```
let vPosition = new Vector(10, 10);
let vForce = new Vector(0, 1);
vPosition.add(vForce); // [0, 11];
```

## Using the es5 bundle in browser
```
npm install --save wtc-vector
```
### Using gulp
Add the final module to your JS bundle.
```
...JS bundle logic
node_modules/wtc-vector/dist/es5-bundle.js
```
The module will then be exposed inside ```window``` as ```window.WTCVector.default```
#### Example
```
<script>
  var vector = new window.WTCVector.default(0,0);
</script>
```
## Documentation
Documentation can be found [here](https://wethegit.github.io/wtc-vector/docs/)

## Demos
The following demos provide proofs and interactive examples of the Vector class:
- [Basic demo](https://wethegit.github.io/wtc-vector/demo/)

   A basic Vector demonstration.
- [Addition proof](https://wethegit.github.io/wtc-vector/demo/addition/)

   A basic proof of addition with vectors, with associated display.
- [Unit vectors](https://wethegit.github.io/wtc-vector/demo/unit-vectors/)

   Shows the use of unit vectors and the reasoning behind their use in a vector's redering.
- [Linear transformations](https://wethegit.github.io/wtc-vector/demo/linear-transformations/)

   This demo shows how to calculate linear transformations (specifically in the vector space's unit vectors).
- [Snowflake](https://wethegit.github.io/wtc-vector/demo/snowflake/)

   This demonstrates the use of a rotating vector as a a method of calculating a sinewave and it's applicable use in the animation of a falling snowflake.

---
_Source: https://npm.io/package/wtc-vector · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
