I've look all over the forums and I can't find anything on this. I'm having a problem with the trig functions on OgreMath.
Code: Select all
Real someReal = 0.999903;
Radian someRadian = Math::ACos(someReal);
The expected result is that someRadian would equal 0.0139568 but I keep getting 0.799663 which is what I would get if I took the inverse cosine of a degree value(before everyone races to load Windows Calculator

) . I can't figure out why since the way I read the code for Math::ACos is that it uses math.h's acos(i tested, this does return radians) and then uses the result to construct an instance of a Radian. It may be a problem with the Radian code(though I don't see a problem in the line of code in the Radian constructor) since I get the same result if I copy the Math::ACos code into mine.
Has anyone ever encountered this problem before? I am using Code::Blocks with the VC++ Toolkit 2003 version 1-0-2 of Ogre. I also encountered the same problem with gcc and Dev-Cpp. Thanks!