Mysql ATAN2
From w3cyberlearnings
Contents |
MySQL ATAN2(Y,X) Function
This function returns the arc tangent of Y and X. It is similar to calculate the arc tangent of Y/X, the only different is that the signs of both numbers are used to determine the quadrant of the result.
Syntax ATAN2(Y,X)
- Y is the first number
- X is the second number
ATAN2(Y,X);
Example 1
mysql> SELECT ATAN2(2,2); +-------------------+ | ATAN2(2,2) | +-------------------+ | 0.785398163397448 | +-------------------+ 1 row in set (0.00 sec)
Example 2
mysql> SELECT ATAN2(2,-2); +------------------+ | ATAN2(2,-2) | +------------------+ | 2.35619449019234 | +------------------+ 1 row in set (0.00 sec)