User Tag List

Results 1 to 6 of 6

Thread: about calculate angle question thanks

  1. #1
    No Products Registered

    Join Date
    Sep 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    about calculate angle question thanks

    Hi

    x = _xmouse;
    y = _ymouse*-1;
    angle = Math.atan(y/x)/(Math.PI/180);
    the following is flash as. but in game factory, it has no Math.atan

    any other method to calculate?i have looked for it in long time.....
    my math concept is poor......

    thanks....

  2. #2
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: about calculate angle question thanks

    Atan(Y("ObjectName")/X("ObjectName"))/(3.1415926/180)

    And the 3.1415926 comes up by pressing the Pi button in the expression editor.

  3. #3
    No Products Registered

    Join Date
    Sep 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: about calculate angle question thanks

    HI

    i have re-coded. but it doesn't work.
    in the new condition, i add "always".
    then i set angle to ATan((YMouse*-1)/XMouse)/(3.141592654/180)
    on a arrow pic.
    when running the program, the arrow pic can't rotation according to mouse moving

    thanks for help

  4. #4
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: about calculate angle question thanks

    MMF2/TGF2's trig functions take degrees so you shouldn't need the pi/180 part

  5. #5
    No Products Registered

    Join Date
    Sep 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: about calculate angle question thanks

    @@
    i dont understand what u said...

    u mean to use Multimedia Fusion 2?

  6. #6
    No Products Registered

    Join Date
    Jan 2007
    Location
    NC - USA
    Posts
    261
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: about calculate angle question thanks

    He means that the the 'ATan()' function already returns a degree value, so there is no reason to convert it from radians.

    Also, the clickteam movement controller can do this for you, if I remember correctly:
    General Expressions -> Angle between two points

    Feed in the first object's coordinates, then the second object's, and it will return the angle in degrees.

Similar Threads

  1. Math question for moving on a defined angle.
    By stannellc in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 2nd January 2014, 11:29 PM
  2. Angle question
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th December 2011, 12:41 AM
  3. angle question
    By malospam in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 18th September 2011, 03:10 PM
  4. Shooting an object - calculate angle
    By ToffeeandPebbles in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 26th February 2011, 12:26 AM
  5. How to calculate the angle between 2 points.
    By QS in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 18th April 2010, 02:09 AM

Posting Permissions

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