5.004_02: Complex/Trig: update
[p5sagit/p5-mst-13.2.git] / lib / Math / Trig.pm
index f40576a..a1cbb07 100644 (file)
@@ -19,9 +19,9 @@ use vars qw($VERSION $PACKAGE
 
 $VERSION = 1.00;
 
-my @angcnv = qw(rad_to_deg rad_to_grad
-            deg_to_rad deg_to_grad
-            grad_to_rad grad_to_deg);
+my @angcnv = qw(rad2deg rad2grad
+            deg2rad deg2grad
+            grad2rad grad2deg);
 
 @EXPORT = (@{$Math::Complex::EXPORT_TAGS{'trig'}},
           @angcnv);
@@ -47,17 +47,17 @@ sub remt ($$) {
 # Angle conversions.
 #
 
-sub rad_to_deg ($)  { remt(RD * $_[0], 360) }
+sub rad2deg ($)  { remt(RD * $_[0], 360) }
 
-sub deg_to_rad ($)  { remt(DR * $_[0], pi2) }
+sub deg2rad ($)  { remt(DR * $_[0], pi2) }
 
-sub grad_to_deg ($) { remt(GD * $_[0], 360) }
+sub grad2deg ($) { remt(GD * $_[0], 360) }
 
-sub deg_to_grad ($) { remt(DG * $_[0], 400) }
+sub deg2grad ($) { remt(DG * $_[0], 400) }
 
-sub rad_to_grad ($) { remt(RG * $_[0], 400) }
+sub rad2grad ($) { remt(RG * $_[0], 400) }
 
-sub grad_to_rad ($) { remt(GR * $_[0], pi2) }
+sub grad2rad ($) { remt(GR * $_[0], pi2) }
 
 =head1 NAME
 
@@ -73,7 +73,7 @@ Math::Trig - trigonometric functions
        
        $halfpi = pi/2;
 
-       $rad = deg_to_rad(120);
+       $rad = deg2rad(120);
 
 =head1 DESCRIPTION
 
@@ -150,17 +150,24 @@ The following functions
        acoth
 
 cannot be computed for all arguments because that would mean dividing
-by zero. These situations cause fatal runtime errors looking like this
+by zero or taking logarithm of zero. These situations cause fatal
+runtime errors looking like this
 
        cot(0): Division by zero.
        (Because in the definition of cot(0), the divisor sin(0) is 0)
        Died at ...
 
-For the C<csc>, C<cot>, C<asec>, C<acsc>, C<csch>, C<coth>, C<asech>,
-C<acsch>, the argument cannot be C<0> (zero). For the C<atanh>,
-C<acoth>, the argument cannot be C<1> (one). For the C<tan>, C<sec>,
-C<tanh>, C<sech>, the argument cannot be I<pi/2 + k * pi>, where I<k> is
-any integer.
+or
+
+       atanh(-1): Logarithm of zero.
+       Died at...
+
+For the C<csc>, C<cot>, C<asec>, C<acsc>, C<acot>, C<csch>, C<coth>,
+C<asech>, C<acsch>, the argument cannot be C<0> (zero).  For the
+C<atanh>, C<acoth>, the argument cannot be C<1> (one).  For the
+C<atanh>, C<acoth>, the argument cannot be C<-1> (minus one).  For the
+C<tan>, C<sec>, C<tanh>, C<sech>, the argument cannot be I<pi/2 + k *
+pi>, where I<k> is any integer.
 
 =head2 SIMPLE (REAL) ARGUMENTS, COMPLEX RESULTS
 
@@ -193,14 +200,14 @@ and the imaginary part of approximately C<-1.317>.
 
 (Plane, 2-dimensional) angles may be converted with the following functions.
 
-       $radians  = deg_to_rad($degrees);
-       $radians  = grad_to_rad($gradians);
+       $radians  = deg2rad($degrees);
+       $radians  = grad2rad($gradians);
        
-       $degrees  = rad_to_deg($radians);
-       $degrees  = grad_to_deg($gradians);
+       $degrees  = rad2deg($radians);
+       $degrees  = grad2deg($gradians);
        
-       $gradians = deg_to_grad($degrees);
-       $gradians = rad_to_grad($radians);
+       $gradians = deg2grad($degrees);
+       $gradians = rad2grad($radians);
 
 The full circle is 2 I<pi> radians or I<360> degrees or I<400> gradians.
 
@@ -218,8 +225,8 @@ an answer instead of giving a fatal runtime error.
 
 =head1 AUTHORS
 
-       Jarkko Hietaniemi <F<jhi@iki.fi>>
-       Raphael Manfredi <F<Raphael_Manfredi@grenoble.hp.com>>
+Jarkko Hietaniemi <F<jhi@iki.fi>> and 
+Raphael Manfredi <F<Raphael_Manfredi@grenoble.hp.com>>.
 
 =cut