Vector2.subtract()

Subtract a vector from this vector

Parameters

NameTypeDescription
1vvector2

Return value

Vector2

The vector with its new values

Usage

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

let vector1 = new Vector2(5,5);
let vector2 = new Vector2(2,3);
console.log(vector1); //(5,5)
vector1.subtract(vector2);
console.log(vector1); //(3,2)