Skip to Content
Programming Perl, 3rd Edition
book

Programming Perl, 3rd Edition

by Larry Wall, Tom Christiansen, Jon Orwant
July 2000
Intermediate to advanced
1104 pages
35h 1m
English
O'Reilly Media, Inc.
Content preview from Programming Perl, 3rd Edition

Math::Trig

use Math::Trig;

$x = tan(0.9);
$y = acos(3.7);
$z = asin(2.4);

$halfpi = pi/2;

$rad = deg2rad(120);

Perl itself defines only three trigonometric functions: sin, cos, and atan2. The Math::Trig module overrides these with fancier versions and supplies all the rest of the trig functions, including tan, csc, cosec, sec, cot, cotan, asin, acos, atan, sinh, cosh, tanh, and many others. Additionally, the constant pi is defined, as are conversion functions like deg2rad and grad2rad. Support is provided for Cartesian, spherical, and cylindrical coordinates systems. This module makes implicit use of Math::Complex as needed (and vice versa) for computations requiring imaginary numbers.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Perl, 4th Edition

Programming Perl, 4th Edition

Tom Christiansen, brian d foy, Larry Wall, Jon Orwant
Learning Perl, 7th Edition

Learning Perl, 7th Edition

Randal L. Schwartz, brian d foy, Tom Phoenix
Programming the Perl DBI

Programming the Perl DBI

Tim Bunce, Alligator Descartes

Publisher Resources

ISBN: 0596000278Supplemental ContentErrata