Vector2.setFromAngle()

Set the x and y values of the vector from the angle given as parameter

Parameters

NameTypeDescription
1anglenumber

Return value

Vector2

The vector with its new values

Usage

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

let angle = 2;
let vector = new Vector2(1,1);
console.log(vector); //(1,1)
vector.setFromArray(array);
console.log(vector); //(2,2)