411 REFERENCE · Wikibooks
Perl Programming/Keywords/atan2
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Perl and AUTOLOAD Keywords
The atan2 keyword
atan2 is the trigonometric function tangent that returns the arctangent of Y/X in the range -π to π.
Syntax
atan2 Y, X
Examples
The code *PI = \3.1415926535;
$a = 3;
$b = 5;
$arctan = atan2($a, $b);
print "arctan(" . $a . ", " . $b . ") = " . $arctan . " rad = " . $arctan*180/$PI . " deg\n"; prints the arc tangent in radians and degrees: 0.540419500270584 rad = 30.9637565329585 deg
Perl and AUTOLOAD Keywords