Skip to main content

ATAN

Description

Returns the arctangent of x, where x is in radians.

Syntax

ATAN(<x>)

Parameters

ParameterDescription
<x>The value for which the atan value is to be calculated

Return Value

The atan value of parameter x.

Special Cases

  • When x is NaN, returns NaN
  • When x is positive infinity, returns π/2 (approximately 1.570796326794897)
  • When x is negative infinity, returns -π/2 (approximately -1.570796326794897)
  • When x is NULL, returns NULL

Examples

select atan(0);
+-----------+
| atan(0.0) |
+-----------+
| 0 |
+-----------+
select atan(2);
+--------------------+
| atan(2.0) |
+--------------------+
| 1.1071487177940904 |
+--------------------+
select atan(cast('nan' as double));
+-----------------------------+
| atan(cast('nan' AS DOUBLE)) |
+-----------------------------+
| NaN |
+-----------------------------+
select atan(cast('inf' as double));
+-----------------------------+
| atan(cast('inf' AS DOUBLE)) |
+-----------------------------+
| 1.570796326794897 |
+-----------------------------+
select atan(cast('-inf' as double));
+------------------------------+
| atan(cast('-inf' AS DOUBLE)) |
+------------------------------+
| -1.570796326794897 |
+------------------------------+