Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

MySQL ATAN2() function

ATAN2() function

MySQL ATAN2() returns the arc tangent of two numbers for a point on a Cartesian plane.The reverse function is TAN().

Syntax:

ATAN2(num1, num2);

Arguments:

Name Description
num1 A number.
num2 A number.

Syntax Diagram:

MySQL ATAN2() Function - Syntax Diagram

MySQL Version: 5.6


Example:

Code:

SELECT ATAN2(-3,2);

Explanation:

The above MySQL statement will return the arc tangent in radians of -3 and 2 for a point in a Cartesian plane.

Sample Output:

mysql> SELECT ATAN2(-3,2);
+--------------------+
| ATAN2(-3,2)        |
+--------------------+
| -0.982793723247329 | 
+--------------------+
1 row in set (0.01 sec)

All Mathematical Functions

MySQL Mathematical Functions, slide presentation

Previous: ASIN()
Next: ATAN()