February 2012
Intermediate to advanced
1184 pages
37h 17m
English
atan2Y,X
This function returns the principal value of the arc tangent 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 tan function from the Math::Trig or the POSIX modules, or just use the familiar relation:
sub tan { sin($_[0]) / cos($_[0]) }If either or both arguments are 0, the return value is implementation defined; see your atan2(3) manpage for more information.
Read now
Unlock full access