use Math::Trig; # to get PI my $sinerand = sin( rand() * PI );