User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16

Thread: What is the function/calculation for...

  1. #11
    No Products Registered

    Join Date
    Jun 2006
    Location
    Plymouth, UK
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What is the function/calculation for...

    +360 or -360 has always worked for me <img src="/center/images/graemlins/smile.gif" alt="" />

  2. #12
    No Products Registered

    Join Date
    Jun 2006
    Location
    Plymouth, UK
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What is the function/calculation for...

    +360 or -360 has always worked for me <img src="/center/images/graemlins/smile.gif" alt="" />

  3. #13
    No Products Registered

    Join Date
    Jul 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What is the function/calculation for...

    The function is Mod.

    400 Mod 360 = 40

    apparently in MMF it doesn't work for negative numbers. This is also the case for many programming languages, although as someone above pointed out there is a well-defined result in mathematics:
    -10 Mod 360 = 350 (*doesn't work in MMF)

  4. #14
    No Products Registered

    Join Date
    Jul 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What is the function/calculation for...

    The function is Mod.

    400 Mod 360 = 40

    apparently in MMF it doesn't work for negative numbers. This is also the case for many programming languages, although as someone above pointed out there is a well-defined result in mathematics:
    -10 Mod 360 = 350 (*doesn't work in MMF)

  5. #15
    Clicker Fusion 2.5

    Join Date
    Jul 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What is the function/calculation for...

    To maintain the angle within the 0-360 boundaries, test with :
    angle = angle - floor(angle/360)*360

    Some examples :
    -10 : -10 - (-1)*360 = 350
    -500 : -500 - (-2)*360 = 220
    1000 : 1000 - (2)*360 = 280

    looks ok to me.

    Edit : Joshtek says -4 won't be wrapped, however, Floor should return the nearest integer BELOW the given number, that is to say, floor(-4/360) should return -1.

  6. #16
    Clicker Fusion 2.5

    Join Date
    Jul 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What is the function/calculation for...

    To maintain the angle within the 0-360 boundaries, test with :
    angle = angle - floor(angle/360)*360

    Some examples :
    -10 : -10 - (-1)*360 = 350
    -500 : -500 - (-2)*360 = 220
    1000 : 1000 - (2)*360 = 280

    looks ok to me.

    Edit : Joshtek says -4 won't be wrapped, however, Floor should return the nearest integer BELOW the given number, that is to say, floor(-4/360) should return -1.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Function Eggtimer problem // Power Function for MMF2 Android?
    By ogrgkyle in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th May 2013, 03:17 AM
  2. calculation help
    By aylictal in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st May 2013, 02:45 PM
  3. Angle calculation bug?
    By Fanotherpg in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 23rd April 2012, 09:38 AM
  4. Angle Calculation
    By lincore in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 17th October 2008, 12:53 PM

Posting Permissions

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