Perl Programming/Keywords/sin
< Perl Programming | Keywords
The sin keyword
[edit | edit source]sin is the trigonometric function sine that assumes that X is in radians.
Syntax
[edit | edit source] sin(X)
Examples
[edit | edit source]![](http://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Crystal_Clear_action_apply.png/20px-Crystal_Clear_action_apply.png)
*PI = \3.1415926535;
$a = 30; # in degrees
$sin = sin($a/180*$PI);
print "sin(" . $a . "°) = " . $sin . "\n";