Book HomeJava and XSLTSearch this book

8.147. Math::Trig

Defines many trigonometric functions not defined by the core Perl, plus the constant pi and some additional functions for converting angles. For example:

use Math::Trig;
            
$x = tan(0.9);
$halfpi = pi/2;

The following functions are defined. A slash (/) between two functions means the values are aliases.

acsc/acosec, asec, acot/acotan
Arcus cofunctions of sine, cosine, and tangent

acsch/acosech, asech, acoth/acotanh
Arcus cofunctions of hyperbolic sine, cosine, and tangent

asin, acos, atan
Arcus (inverse) functions of sine, cosine, and tangent

asinh, acosh, atanh
Arcus functions of hyperbolic sine, cosine, and tangent

atan2(y, x)
Principal value of arc tangent of y/x

csc/cosec, sec, cot/cotan
Cofunctions of sine, cosine, and tangent

csch/cosech, sech, coth/cotanh
Cofunctions of hyperbolic sine, cosine, and tangent

deg2rad
Degrees to radians

deg2grad
Degrees to gradians

grad2deg
Gradians to degrees

grad2rad
Gradians to radians

pi
The trigonometric constant Figure 8.147

rad2deg
Radians to degrees

rad2grad
Radians to gradians

sinh, cosh, tanh
Hyperbolic sine, cosine, and tangent

tan
Tangent



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.