atan2()
returns the arctangent2 of a set of coordinates in radians. It is calculated similar to calculation of arctangent of y/x, but signs of both the arguments(x and y) are used to determine the quadrant of the result.
Syntax: atan2(expression1, expression2)
Returns: A Float.
Arguments
Name | Description |
expression1 | A numeric expression for y that represents the angle in radians. |
expression2 | A numeric expression for x that represents the angle in radians. |
Example
RETURN atan2(0.5, 0.6)
The value returned will be the arctangent of 0.5 and 0.6 radians, which is 0.6947382761967033.
Considerations
atan2(null, null)
returnsnull
.atan2(expression1, null)
returnsnull
.atan2(null, expression2)
returnsnull
.
Example
RETURN atan2(0.1, 0.4)
Returns the following Result
atan2(0.1, 0.4) |
0.24497866312686414 |
Example
RETURN atan2(0.4, 0.1)
Returns the following Result
atan2(0.4, 0.1) |
1.3258176636680326 |
Example
RETURN atan2(0.8, 0)
Returns the following Result
atan2(0.8, 0) |
1.5707963267948966 |
Example
RETURN atan2(-4, -4)
Returns the following Result
atan2(-4, -4) |
-2.356194490192345 |
Example
RETURN atan2(0, 0)
Returns the following Result
atan2(0, 0) |
0.0 |
Example
RETURN atan2(1, null)
Returns the following Result
atan2(1, null) |
null |
Note– atan2(expression1, null)
returns null
.
Example
RETURN atan2(null, 0)
Returns the following Result
atan2(null, 0) |
null |
Note– atan2(null, expression2)
returns null
.
Example
RETURN atan2(null, null)
Returns the following Result
atan2(null, null) |
null |
Note– atan2(null, null)
returns null
.