PostgreSQL ATAN2
From w3cyberlearnings
Contents |
Postgresql ATAN2
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 is the first number
- X is the second number
ATAN2(X);
Example 1
postgres=# SELECT ATAN2(2,2); atan2 ------------------- 0.785398163397448 (1 row)
Example 2
postgres=# SELECT ATAN2(2,-2); atan2 ------------------ 2.35619449019234 (1 row)