pawno calculates the cosinus of an angle different than my calculator?! - 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: pawno calculates the cosinus of an angle different than my calculator?! (
/showthread.php?tid=65938)
pawno calculates the cosinus of an angle different than my calculator?! -
ғαιιοцт - 17.02.2009
pawno:
Код:
floatcos(136.0) = -0.596
and my calculator:
why?
another example:
pawno:
Код:
floatcos(60.0) = -0.88
calculator:
...
Re: pawno calculates the cosinus of an angle different than my calculator?! -
MaXx001 - 17.02.2009
Because pawn uses radians as default.
floatcos is defined as follows:
Код:
floatcos Return the cosine of an angle
Syntax: Float: floatcos(Float: value, anglemode: mode=radian)
value: The value to calculate the cosine of.
mode: Specifies whether the angle (in parameter value) is specified in degrees (sexagesimal system), grades (centesimal system) or radian. The default is radian.
Returns: The result: the cosine of the input number.
Re: pawno calculates the cosinus of an angle different than my calculator?! -
ғαιιοцт - 17.02.2009
Quote:
Originally Posted by MaXx001
Because pawn uses radians as default.
floatcos is defined as follows:
Код:
floatcos Return the cosine of an angle
Syntax: Float: floatcos(Float: value, anglemode: mode=radian)
value: The value to calculate the cosine of.
mode: Specifies whether the angle (in parameter value) is specified in degrees (sexagesimal system), grades (centesimal system) or radian. The default is radian.
Returns: The result: the cosine of the input number.
|
ok thanks, it works now