Need to covert these lines from C++ to Javascript
Hi everyone,
I'm still learning java and I have this code that I used in a C++ app and now need to convert it to java. Can anyone help me?
It is mainly the vx and vy lines I don't know how to convert
Thanks!
Code:
float spd = 200;
double deg = 45;
double rad;
rad = 3.14159265358979323846 / 180 * deg;
vx = (float)cos(rad) * spd;
vy = (float)sin(rad) * spd;
X1 = 150;
Y1 = 380;
Re: Need to covert these lines from C++ to Javascript
Actually for the vy line would I do this for it?
Code:
vy = math.sin(rad) * spd;
Re: Need to covert these lines from C++ to Javascript