sin(360)
returns -2.44921e-016?
However:
sin(0)
returns 0?
Can anyone tell me why this:
sin(360) returns -2.44921e-016? However: sin(0) returns 0? |
You do realize that -2.44921e-016 is an incredibly small number?
Looks kinda like this: -0.0000000000000000244921 It's effectively 0 and isn't because of floating point accuracy. cos(180) is definitely -1. Angles for cos() and sin() start at 0 = EAST and increase counter-clockwise. |
In response to Super Saiyan X
|
|
Super Saiyan X wrote:
Is it bad that I find this image beautiful? |
Returns exactly -1.
Seeing as cos() would be used to grab an x value, it clearly should not be returning -1 for an angle of 180.
EDIT: After thinking about this, I realized that the angles may be starting at what I assume as 90 degrees - I thought that maybe 0 degrees is actually representing EAST. I checked into this with an online calculator and tried cos(90), and I got 0. This made me think that I was right and that was why I was getting this stuff wrong, but when I asked DM to tell me what cos(90) was, it told me this:
6.12303e-017
So can I just not work with angles or what?
EDIT2: After looking in F1, I see that even the cos() proc has this example in its entry:
So I'm starting to think that maybe this is a bug.