PERL atan2 Function

Syntax

atan2 Y,X

Definition and Usage

Returns the arctangent of Y/X in the range -PI to PI.

Return Value

  • arctangent of Y/X in the range -PI to PI.

Example

Following is the piece of code, copy and paste this code into a file and verify the result.
#!/usr/bin/perl

$Y = 30;
$X = 60;

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

print "atan2 of 30/60 is : $retvaln";
This will produce following result
atan2 of 30/60 is : 0.463647609000806
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s