[ad_1]
Recreation Growth Stack Trade is a query and reply website for skilled and impartial sport builders. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The most effective solutions are voted up and rise to the highest
Requested
Considered
19 instances
$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 = ???
$endgroup$
0
default
[ad_2]