vectr2
v0.1.0
Published
A simple 2d Vector class in javascript
Downloads
3
Readme
vectr2
Simple 2d vector class in javascript.
npm install vectr2 --save
Vectr2 = require('vectr2');
var vectorA = new Vectr2(0,0);
var vectorB = new Vectr2(1,2);
Project onto another vector.
var vectorC = vectorA.project(vectorB);
Get the dot product.
var dotProd = vectorA.dot(vectorB);
Find the angle between two vectors.
var theta = vectorA.angle(vectorB);