start page | rating of books | rating of authors | reviews | copyrights

Programming Perl

Programming PerlSearch this book
Previous: 3.2.5 alarm Chapter 3
Functions
Next: 3.2.7 bind
 

3.2.6 atan2

atan2 

Y

, 

X

This function returns the arctangent of Y / X in the range -[pi] to [pi]. A quick way to get an approximate value of [pi] is to say:

$pi = atan2(1,1) * 4;

For the tangent operation, you may use the POSIX::tan() function, or use the familiar relation:

sub tan { sin($_[0]) / cos($_[0]) }


Previous: 3.2.5 alarm Programming Perl Next: 3.2.7 bind
3.2.5 alarm Book Index 3.2.7 bind