1.1.2 • Published 3 years ago

ezvector v1.1.2

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

EzVector

EzVector is Vector calculation module.

Installation

You can use npm to install EzVector.

npm i ezvector

or

npm install ezvector

Usage and Examples

const EzVector = require('ezvector');

or

import { Vector2, Vector3, Vector4, Distance } from 'ezvector';

or

import EzVector from 'ezvector';

Example: 2D Circle collision detection

import { Vector2, Distance } from 'ezvector';
let circle1 = { position: new Vector2(0, 0), r: 10 };
let circle2 = { position: new Vector2(0, -21), r: 10 };

const collision = (circle1, circle2) => {
  if (Distance(circle1.position, circle2.position) <= circle1.r + circle2.r)
    console.log('YES');
  else console.log('NO');
};

collision(circle1, circle2);
circle2.position.y = -5;
collision(circle1, circle2);

Contributing

GitHub - EzVector

License

MIT

EzVector 1.1.*

Welcome to EzVector 1.1.*!

  • Added support for typescript.

  • Changed Multiply function.

  • Removed maps and some other things to keep EzVector simple! (I will publish another package for maps soon. If you need them, you can still use EzVector@1.0.9)

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago