For the complete documentation index, see llms.txt. This page is also available as Markdown.

ATAN2

Calculate arc tangent of two variables. This function returns the angle in radians between the positive x-axis and the point (X, Y).

Syntax

ATAN(Y,X), ATAN2(Y,X)

Description

Returns the arc tangent of the two variables X and Y. It is similar to calculating the arc tangent of Y / X, except that the signs of both arguments are used to determine the quadrant of the result.

Examples

SELECT ATAN(-2,2);
+---------------------+
| ATAN(-2,2)          |
+---------------------+
| -0.7853981633974483 |
+---------------------+

SELECT ATAN2(PI(),0);
+--------------------+
| ATAN2(PI(),0)      |
+--------------------+
| 1.5707963267948966 |
+--------------------+

This page is licensed: GPLv2, originally from fill_help_tables.sql

spinner

Last updated

Was this helpful?