pi vs 14.3239448783..

i know this topic sounds quite stupid, but few days ago i had a problem. i had to convert a radians in degree and i wasnt sure about the calculation, so i used my dirksche converting method :smiley: at first.

like alpha360/9014.333
the normal method is: alpha/pi*180

at a radians of 1.57 (90 degrees) i get the result at my convertion 90.01124 and at the standard calculation with pi i get 89.9570. i know that i have to use pi, but my calculation is much closer to 90 degrees. where is the egg? this makes me kinda grey hairs!!!

you know… pythons offers convenient functions to convert back and forth between radians and degrees… you might want to read the some documentation about it. should be in the math module.

im learning since few week c++, there i havnt found the degree converting in the math modul. thats why i had to calculate it by hand. but im nearly sure its in python solved on the normal good used way, like alpha/pi*180. where the result seems to be to me much more none exact. i dont wanna fight against the pi, i just wanna know why it is, that my way is closer to the known result as it is with pi? im not a mathematics, so i just used my poor mathematical logic to solve it.

Then look up the Panda3D documentation for the C++ methods rad_2_deg and deg_2_rad.

i dont think its faster to use this method than to calc this by hand. my question is, why is the pi result, the recommend way, solving this calculation with a bigger difference than im using my way. so the both calculations works for me, im just wondering about the result of pi and the result of my method (which seems to me more exact).

and im sure, im getting the same result of the pi converting calculation if im using rad_2_deg.

i only want a answer of a mathematics person, why i get a closer result with my calculation, than im using the old good one method for circle discribing pi.

You got an answer from a ‘mathematics’ person. My thesis has been on cosmology (theoretical physics).

Because 1.57 radians is NOT 90 degrees. 90 degrees is pi/2, and pi is not 3.14(0000000…).

If you feed a better approximation to 90 degrees to your method and the real ones, for example 1.5707963267948966, then you will see that the real methods get closer to 90 degrees while your method becomes even worse.

yes that is it, i used a double var for getting the radians. thanks that solved it. :slight_smile:

so now to correct my way, the correct value is 14.3239448783… and not 14.33333333…