# Perl Programming/Keywords/cos

< Perl Programming | Keywords

< Perl Programming | Keywords

Previous: CORE | Keywords | Next: crypt |

`cos` is the trigonometric function cose that assumes that `X` is in radians.

```
cos(X)
```

The code
prints the cosine of the angle of 30 degrees:

```
*PI = \3.1415926535;
$a = 30; # in degrees
$cos = cos($a/180*$PI);
print "cos(" . $a . "°) = " . $cos . "\n";
```

Previous: CORE | Keywords | Next: crypt |