@smarsh1/vector2

1.0.6 • Public • Published

vector2

vector2 is vector calculator

Usage / Installation

You can install vector2 using npm

npm i @smarsh1/vector2

Example

const Vector = require('@smarsh1/vector2');

let vec = new Vector(2, 3);

console.log(vec.add(5, 6));

// expected output: 7, 9 

Documentation

Constructor

const Vector = new Vector2(x, y) 

Add

add(x, y);
// 
add(otherVector);

Subtract

sub(x, y);
//
sub(otherVector);

Multiplcate

multi(x, y);
//
multi(otherVector);

Divade

div(x, y)
//
div(otherVector)

Lenght

len()

Normalize

norm()

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @smarsh1/vector2

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

2.34 kB

Total Files

3

Last publish

Collaborators

  • smarsh1