Q: I'm sure I've got the trig functions declared correctly, but they're still giving me wrong answers.
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)