atan2(1, 0), atan2(-1, 0), atan2(0, 0) : atan2 « Math Functions « PostgreSQL






atan2(1, 0), atan2(-1, 0), atan2(0, 0)


postgres=# SELECT atan2(1, 0) AS positive_x,
postgres-#        atan2(-1, 0) AS negative_x,
postgres-#        atan2(0, 0) AS zero_x,
postgres-#        pi() / 2 AS pi_over_two;
   positive_x    |    negative_x    | zero_x |   pi_over_two
-----------------+------------------+--------+-----------------
 1.5707963267949 | -1.5707963267949 |      0 | 1.5707963267949
(1 row)

postgres=#

           
       








Related examples in the same category

1.atan2(x, y): Returns the inverse tangent of the quotient of x and y