X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMath%2FTrig.pm;h=a1cbb0723403eaf03e52f843450a9e33fe6a6e61;hb=8c03c583a5f470c68c67a27898643a5dafca2d66;hp=f40576a6cc80a1f4bf417b7a8070962a0a08bc4f;hpb=4ae80833094c9f785b5bbead992abe3e19d8928b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Math/Trig.pm b/lib/Math/Trig.pm index f40576a..a1cbb07 100644 --- a/lib/Math/Trig.pm +++ b/lib/Math/Trig.pm @@ -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, C, C, C, C, C, C, -C, the argument cannot be C<0> (zero). For the C, -C, the argument cannot be C<1> (one). For the C, C, -C, C, the argument cannot be I, where I is -any integer. +or + + atanh(-1): Logarithm of zero. + Died at... + +For the C, C, C, C, C, C, C, +C, C, the argument cannot be C<0> (zero). For the +C, C, the argument cannot be C<1> (one). For the +C, C, the argument cannot be C<-1> (minus one). For the +C, C, C, C, the argument cannot be I, where I 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 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 > - Raphael Manfredi > +Jarkko Hietaniemi > and +Raphael Manfredi >. =cut