Sin and Cos give unexpected results for well-known angles
I am sure this is a really stupid question, but when I pass an angle of 180 degrees into c/c++'s cos() and sin() functions I appear to receive an incorrect value. I know that it should be: sin of 0.0547 and cos of 0.99 but I get sin of 3.5897934739308216e-009 and cos of -1.00000 My code is: double radians = DegreesToRadians( angle ); double cosValue = cos( radians ); double sinValue = sin( radians ); DegreesToRadians() is: double DegreesToRadians( double degrees ) { return degrees * PI / 180; } Thank you :) C/C++ provides sin(a) , cos(a) , tan(a) , etc. functions that require a parameter with