Intallation

npm

npm install @lcluber/type6js

Yarn

yarn install @lcluber/type6js

ES Module usage

import {Vector2} from '@lcluber/type6js';

let a = new Vector2();
let b = new Vector2(4,5);
let c = new Vector2(7,-5);
let d = new Vector2(-3,-3);

if ( a.copy(c)
      .subtract(b)
      .absolute()
      .opposite()
      .add(d)
      .isPositive()
) {
  return true;
} else {
  return false;
}

IIFE usage

// HTML import : <script src="node-modules/@lcluber/type6js/dist/type6.iife.min.js"></script>

let a = new Type6.Vector2();
let b = new Type6.Vector2(4,5);
let c = new Type6.Vector2(7,-5);
let d = new Type6.Vector2(-3,-3);

if ( a.copy(c)
      .subtract(b)
      .absolute()
      .opposite()
      .add(d)
      .isPositive()
) {
  return true;
} else {
  return false;
}

CommonJS usage

const Type6 = require('@lcluber/type6js/dist/type6.cjs');

let a = new Type6.Vector2();
let b = new Type6.Vector2(4,5);
let c = new Type6.Vector2(7,-5);
let d = new Type6.Vector2(-3,-3);

if ( a.copy(c)
      .subtract(b)
      .absolute()
      .opposite()
      .add(d)
      .isPositive()
) {
  return true;
} else {
  return false;
}