Atan2 () PHP Function

Definition: We can use the Atan () function to figure out the arc tangent of a number. We can also use the Atan2 () function to figure out the arc tangent of a point given two coordinates. It is written as atan(Y,X) and calculates the arc tangent of Y/X. The result will always be between -PI and PI radians.
Also Known As: Arc Tangent, Arctangent
Examples:
 <?php
 echo(atan2(5,5) . "<br />");
 echo(atan2(-3,4))
 ?>

This will return:
0.78539816339745
-0.64350110879328

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