Core Function Sin
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> Sin( <expression> ) </pre> === Description === Returns the sine of the specified angle. === Parameters === ==== expression ==== Value in radians. === Return Value ===...") |
(→Example) |
||
Line 25: | Line 25: | ||
<syntaxhighlight lang="sputnik"> | <syntaxhighlight lang="sputnik"> | ||
$Param = 30.0; | $Param = 30.0; | ||
− | $Result = | + | $Result = Sin($Param* @PI / 180.0); |
print("The sine of $Param degrees is $Result."); | print("The sine of $Param degrees is $Result."); | ||
Latest revision as of 19:06, 2 December 2011
Sin( <expression> )
Contents |
Description
Returns the sine of the specified angle.
Parameters
expression
Value in radians.
Return Value
Returns the trigonometric sine of number.
Remarks
1° = pi / 180 radians.
Example
$Param = 30.0; $Result = Sin($Param* @PI / 180.0); print("The sine of $Param degrees is $Result."); $x = Sin(@PI / 4.0); println($x); // returns 0.707106781186547 which you should recognize as sqrt(2)/2 $degToRad = @PI / 180.0; $y = Sin(90.0 * $degToRad); println($y); // sine of 90°