Skip to content

ATAN2

  • y: The Y-coordinate of a point in the two-dimensional plane. The ATAN2 function uses this value to calculate the arctangent of the ratio Y/X.
  • x: The X-coordinate of a point in the two-dimensional plane. This value is the divider in the ratio Y/X used by ATAN2 to calculate the arctangent.
SELECT ATAN2(1,0) as Atan;
+---------------------+
| Atan |
+---------------------+
| 1.5707963267948966 |
+---------------------+

The ATAN2 function in MySQL takes two arguments and returns the arc tangent of the two variables. The ATAN2(1,0) returns 1.5707963267948966 which is π/2 in radians. This example demonstrates the usage of ATAN2 function in MySQL to calculate the arc tangent value.