Perl atan2 Function


Advertisements


Description

This function returns the arctangent of Y/X in the range -PI to PI.

Syntax

Following is the simple syntax for this function:

atan2 Y,X

Return Value

This function returns arctangent of Y/X in the range -PI to PI.

Example

Following is the example code showing its basic usage −

#!/usr/bin/perl

$Y = 30;
$X = 60;

$ret_val = atan2 ($Y, $X );

print "atan2 of 30/60 is : $retval\n";

When above code is executed, it produces the following result −

atan2 of 30/60 is :


Advertisements