User Tag List

Results 1 to 6 of 6

Thread: Something is very wrong with Sin() and Cos()

  1. #1
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Something is very wrong with Sin() and Cos()

    http://www.LB-Stuff.com/Flash/SinCosFlashTest.html

    As you can see, Sin() Cos() do not return the correct values. Just try Cos(90) or Sin(180)! It returns something waaaaaaay outside the -1.0 to 1.0 rane it should.
    Working as fast as I can on Fusion 3

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Something is very wrong with Sin() and Cos()

    Cos(90) says 6.123031769111886e-17 - Now that might seem like a huge number.
    However, it uses the scientific notation. 123e-17 means 123*10^(-17). That's 0.00000000000000123!
    So, this huge number actually is just 0.00000000000000006123031769111886.
    That's pretty close to zero - It's not zero because floats are too inaccurate for that.

    EDIT: Fixed an error, thanks to Dynasoft

  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Something is very wrong with Sin() and Cos()

    Yeah, it's messing up my game that uses 360 degrees floating point accuracy movement.
    Working as fast as I can on Fusion 3

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Something is very wrong with Sin() and Cos()

    Quote Originally Posted by Looki
    Cos(90) says 6.123031769111886e-17 - Now that might seem like a huge number.
    However, it uses the scientific notation. 123e-17 means 123*10^(-17). That's 0.00000000000000123!
    So, this huge number actually is just 0.06123031769111886.
    It's 6.1 * 10^-17...
    Or 0.00000000000000006123031769111886


    LB: I don't see that as being significant enough to screw up a 360 movement...

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Something is very wrong with Sin() and Cos()

    Ah, ouch, I didn't notice that when inserting it into calc.exe (Yes, I'm that lazy) - Yay for German Windows using "," for decimals and therefore interpreting 6,123 as 6123.

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Something is very wrong with Sin() and Cos()

    Well I am not sure why either, but instead of going straight down with gravity agnled at 270, it goes diagonal down-right and completely ignores the force of gravity. The file is in the FIle Archive, my "Help with Bouncing" thread. I guess I need double the help, then.
    Working as fast as I can on Fusion 3

Similar Threads

  1. Can someone tell me what's wrong here?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 6th June 2012, 07:14 AM
  2. I don't know what is wrong
    By Tharky in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 11th July 2010, 10:34 PM
  3. What did I do wrong here?
    By Almightyzentaco in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 5th March 2009, 12:26 AM
  4. can someone tell me where i am going wrong please
    By arma in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 22nd May 2007, 08:18 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
  •