SA-MP Forums Archive
Degrees and radian... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Degrees and radian... (/showthread.php?tid=121324)



Degrees and radian... - ¤Adas¤ - 16.01.2010

Please, how can I convert degrees to radian and radian to degrees? Thanks..


Re: Degrees and radian... - ¤Adas¤ - 16.01.2010

No one know? :O


Re: Degrees and radian... - Nero_3D - 16.01.2010

mh

360° = 2pi
x° = ypi

x° = (ypi * 360°) / 2pi;
ypi = (x° * 2pi) / 360°;

and with some simplifications
pawn Код:
#define DegToRad(%1) (%1 / 57.2957795)
#define RadToDeg(%1) (%1 * 57.2957795)
Note: the results arent 100% correct because - like you can see - it divides or multiplies with a number with seven fractional digits


Re: Degrees and radian... - ¤Adas¤ - 16.01.2010

thanks