|
-
Jun 2nd, 2012, 04:25 PM
#1
Thread Starter
Frenzied Member
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;
-
Jun 2nd, 2012, 04:26 PM
#2
Thread Starter
Frenzied Member
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;
-
Jun 3rd, 2012, 02:36 AM
#3
Re: Need to covert these lines from C++ to Javascript
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|