$begingroup$

Given a Vector2(x,y) that represents an object’s velocity, like so:

let angle = Math.PI / 2;
let velocity = 500;
let velocity = new Vector2();

velocity.x = Math.cos(angle) * velocity;
velocity.y = Math.cos(angle) * velocity;

How will you retrieve the velocity?

let angle = Math.atan2(velocity.y, velocity.x);
// let velocity = ??? 

CAOakley is a brand new contributor to this website. Take care in asking for clarification, commenting, and answering.
Take a look at our Code of Conduct.

$endgroup$

0

$begingroup$

Was in a position to get the reply as:

let velocity = Math.sqrt(velocity.x ** 2 + velocity.y ** 2)

CAOakley is a brand new contributor to this website. Take care in asking for clarification, commenting, and answering.
Take a look at our Code of Conduct.

$endgroup$

0