Javatpoint Logo
Javatpoint Logo

PHP atan2() Function

PHP atan2() is also predefined trigonometry function, which is used to return the arc tangent of two variables x and y or returns the angle theta of different (x,y) points with the atan2() function.

Note: The arc tangent of y/x in radians and between -Pi and Pi.

Syntax:

Parameter Description Required/Optional
X Specify the dividend Required
Y Specify the divisor Required

Example 1

Output:

Your number is : (0.50,0.50)
By using 'atan2()' function your number is :0.78539816339745

Example 2

Output:

Your number is : (-0.50,-0.50)
By using 'atan2()' function your number is :0.78539816339745

Example 3

Output:

Your number is : (5,5)
By using 'atan2()' function your number is :0.78539816339745

Example 4

Output:

Your number is : (-5,-5)
By using 'atan2()' function your number is :-2.3561944901923 

Example 5

Output:

Your number is : (-5,5)
By using 'atan2()' function your number is :-0.78539816339745

Next TopicPHP Math





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA