Vector2.set()

Set the x and y values of the vector

Parameters

NameTypeDescription
1xnumberValue of the X axis
2ynumberValue of the Y axis

Return value

Vector2

The vector with its new values

Usage

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

let vector = new Vector2(2,2);
console.log(vector); //(2,2)
vector.set(1,1);
console.log(vector); //(1,1)