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.
Printable View
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.
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
Yeah, it's messing up my game that uses 360 degrees floating point accuracy movement.
It's 6.1 * 10^-17...Quote:
Originally Posted by Looki
Or 0.00000000000000006123031769111886
LB: I don't see that as being significant enough to screw up a 360 movement...
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. :)
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.