1. Perl
  2. builtin functions
  3. here

sin function - find sine

You can use the sin function to find the sine. The angle is easy to specify in radians using π (pi function).

use Math::Trig 'pi';


The pi function to get π in radians is explained in Math::Trig.

Sine function programming example

This is a programming example using the sin function.

use strict;
use warnings;
use Math::Trig 'pi';

# sin(90 °) = 1;
print "sin(π/2) =" . Sin (pi/2) . "\n";

Other trigonometric functions

Perl has cos function as builtin functions in addition to the sin function.

Details on how to use other trigonometric functions such as tangent can be found on the following pages.

Related Informatrion