Vector2.getAngle()

Compute and return the angle in the plane (in radians) between the positive x-axis and the ray from (0,0) to the point (x,y)

Parameters

None

Return value

number

The angle in radians (in [-π,π]) between the positive x-axis and the ray from (0,0) to the point

Usage

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

let vector = new Vector2(1,1);
let angle = vector.getAngle();
console.log(angle);