Computer Science Canada Trigonometry isn't working properly |
Author: | goroyoshi [ Fri Oct 07, 2011 1:57 pm ] | ||||
Post subject: | Trigonometry isn't working properly | ||||
Why does my java code not work like my turing one does?
|
Author: | Tony [ Fri Oct 07, 2011 3:18 pm ] |
Post subject: | RE:Trigonometry isn\'t working properly |
because one uses sin while the other uses sind. I don't think Math.toDegrees does what you think it does. |
Author: | goroyoshi [ Fri Oct 07, 2011 6:47 pm ] |
Post subject: | RE:Trigonometry isn\'t working properly |
so i should just multiply it by 57.3 ? ok so that is what Math.toDegrees does |
Author: | Tony [ Fri Oct 07, 2011 7:10 pm ] |
Post subject: | RE:Trigonometry isn\'t working properly |
What? Read the docs for the version for Java that you are using. |
Author: | andrew. [ Sat Oct 08, 2011 10:10 am ] | ||
Post subject: | RE:Trigonometry isn\'t working properly | ||
I haven't read the Java docs but I'm assuming that sin and the other trig functions in Java take in radian angles. This means that you have to call toRadians on your angle to calculate the sine. So basically:
|
Author: | goroyoshi [ Sun Oct 09, 2011 10:24 am ] |
Post subject: | RE:Trigonometry isn\'t working properly |
i've fixed it already, ty for helping |