1.0.6 • Published 3 years ago

@smarsh1/vector2 v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago