I am sure I've got the trig functions declared correctly, but they are still giving me wrong answers.

Q

I am sure I've got the trig functions declared correctly, but they are still giving me wrong answers.

✍: Guest

A

You weren't handing them angles in degrees, were you? C's trig functions (like FORTRAN's and most other languages) accept angles in radians. The conversion from degrees to radians is simple enough:
sin(degrees * pi / 180)

2015-06-29, 773👍, 0💬