atan2 Y , X

Y

X

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

/

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

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

POSIX::tan()

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

[ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ]