#!/usr/bin/perl -wT
use CGI':standard';
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use Math::Trig;
print header();
print start_html(-title => "Trigonometric Functions");
my $angle1 = 45;
my $angle2 = 30;
#conversion into radians with the predefined pi() from the Trig module
my $rad1 = $angle1 * pi()/180;
my $rad2 = $angle2 * pi()/180;
print "<div style='color:#0000cc;font-size:1.3em;'>";
print "The sine of $angle1 degrees is " . sprintf (sin($rad1)) . "<br>";
print "The cosine of $angle1 degrees is " . sprintf (cos($rad1)) . "<br>";
print "The tangent of $angle1 degrees is " . sprintf (tan($rad1)) . "<br><br>";
print "The sine of $angle2 degrees is " . sprintf (sin($rad2)) . "<br>";
print "The cosine of $angle2 degrees is " . sprintf (cos($rad2)) . "<br>";
print "The tangent of $angle2 degrees is " . sprintf (tan($rad2)) . "<br>";
print "</div>";
print end_html();