Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / lib / Math / Trig.pm
index c659137..492706c 100644 (file)
@@ -7,13 +7,12 @@
 require Exporter;
 package Math::Trig;
 
+use 5.005_64;
 use strict;
 
 use Math::Complex qw(:trig);
 
-use vars qw($VERSION $PACKAGE
-           @ISA
-           @EXPORT @EXPORT_OK %EXPORT_TAGS);
+our($VERSION, $PACKAGE, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
 
 @ISA = qw(Exporter);
 
@@ -37,8 +36,8 @@ my @rdlcnv = qw(cartesian_to_cylindrical
 
 %EXPORT_TAGS = ('radial' => [ @rdlcnv ]);
 
-use constant pi2  => 2 * pi;
-use constant pip2 => pi / 2;
+sub pi2 () { 2 * pi }          # use constant generates warning
+sub pip2 () { pi / 2 }         # use constant generates warning
 use constant DR   => pi2/360;
 use constant RD   => 360/pi2;
 use constant DG   => 400/360;
@@ -133,11 +132,11 @@ Math::Trig - trigonometric functions
 =head1 SYNOPSIS
 
        use Math::Trig;
-       
+
        $x = tan(0.9);
        $y = acos(3.7);
        $z = asin(2.4);
-       
+
        $halfpi = pi/2;
 
        $rad = deg2rad(120);
@@ -259,7 +258,7 @@ complex numbers as results because the C<Math::Complex> takes care of
 details like for example how to display complex numbers. For example:
 
        print asin(2), "\n";
-    
+
 should produce something like this (take or leave few last decimals):
 
        1.5707963267949-1.31695789692482i
@@ -273,10 +272,10 @@ and the imaginary part of approximately C<-1.317>.
 
        $radians  = deg2rad($degrees);
        $radians  = grad2rad($gradians);
-       
+
        $degrees  = rad2deg($radians);
        $degrees  = grad2deg($gradians);
-       
+
        $gradians = deg2grad($degrees);
        $gradians = rad2grad($radians);