Name

atan2

Synopsis

atan2 y, x
                  

Returns the arctangent of y / xin 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:

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

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.