Ok, I've been trying to to find a way of using trig functions in my code, but I've been having nothing but problems.
I've been using the henson Float class, available at:
http://henson.newmail.ru/j2me/Float.htm But the answers it gives me for the cos and sin functions are pure nonsense. I'm trying to convert the degrees to radians and then run the cos and sin functions on them.
It seemed to work fine for a
test value of 60 degrees (1.047 radians), giving me the approximately correct results of cos 1.047 = 0.5001 and sin 1.047 = 0.866
But when I try it with anything else the results are utterly wrong. For example 45 degrees (2 radians), instead of getting 0.707 for both it gives me cos 2 = -0.416 and sin 2 = 0.909 ?
Why does it work for only the one value ?
Has anybody got this float class to work, ever ?
Has anybody got any alternatives ?
Please help me , I'm getting annoyed and desperate for a solution. I've also tried using MathFP, but that kept giving me wrong class name error.