# vector2d-lib

> A 2d JavaScript Vector library.

Latest version **0.0.12** (published 2014-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install vector2d-lib
pnpm add vector2d-lib
yarn add vector2d-lib
bun add vector2d-lib
```

## 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.0.12 |
| Published | 2014-08-12 |
| First published | 2013-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Vince Allen |
| Maintainers | vinceallenvince |
| Keywords | vector, 2d, math |

## Links

- npm: https://www.npmjs.com/package/vector2d-lib
- Repository: http://github.com/vinceallenvince/vector2d-lib
- Issues: https://github.com/vinceallenvince/vector2d-lib/issues
- npm.io page: https://npm.io/package/vector2d-lib

## 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.0.12 (latest) — 2014-08-12
- 0.0.11 — 2014-08-12
- 0.0.10 — 2014-08-12
- 0.0.9 — 2014-08-12
- 0.0.8 — 2014-08-11
- 0.0.7 — 2014-08-11
- 0.0.2 — 2013-10-22
- 0.0.1 — 2013-10-18

## README

# vector2d-lib

A 2d JavaScript Vector library.

##Install

To include vector2d-lib as a component in your project, use the node module.

```
npm install vector2d-lib --save
```

You can also use the [standalone version](https://github.com/vinceallenvince/vector2d-lib/releases/latest) and reference the js file from your document.

```
<html>
  <head>
    <script src="scripts/vector2d-lib.js" type="text/javascript" charset="utf-8"></script>
  </head>
  ...
```

##Usage

The module exports a Vector class. In a nodejs project, you access it via:

```
var Vector = require('vector2d-lib');
var vecA = new Vector(10, 10);
```

In the browser, the Vector class is a global.

To learn how to use the various Vector functions, please review [the docs](http://vinceallenvince.github.io/vector2d-lib/doc/).

```
<html>
  <head>
    <script src="scripts/vector2d-lib.js" type="text/javascript" charset="utf-8"></script>
  </head>
  <body>
    <script>
      var vecA = new Vector(10, 10);
    </script>
  </body>
</html>
```

Building this project
------

This project uses [Grunt](http://gruntjs.com). To build the project first install the node modules.

```
npm install
```

Next, run grunt.

```
grunt
```

To run the tests, run 'npm test'.

```
npm test
```

To check test coverage run 'grunt coverage'.

```
grunt coverage
```

A pre-commit hook is defined in /pre-commit that runs jshint. To use the hook, run the following:

```
ln -s ../../pre-commit .git/hooks/pre-commit
```

A post-commit hook is defined in /post-commit that runs the Plato complexity analysis tools. To use the hook, run the following:

```
ln -s ../../post-commit .git/hooks/post-commit
```

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