Results 1 to 3 of 3

Thread: Need to covert these lines from C++ to Javascript

  1. #1
    Frenzied Member
    Join Date
    Oct 00
    Posts
    1,374

    Question 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;

  2. #2
    Frenzied Member
    Join Date
    Oct 00
    Posts
    1,374

    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;

  3. #3
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 08
    Location
    Trivandrum, Kerala, India
    Posts
    7,559

    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 Athlon X2 5200+, ASUS Motherboard, 2 GB RAM, 400 GB HDD, Nvidia 8600 GT 512MB, 19.5" TFT(Wide), Creative 5.1 Home Theater

    Social Group: VBForums - Developers from India

    Skills: PHP, MySQL, jQuery, VB.Net, VB6, Photoshop...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •