Calculates the arctangent of expr1 and expr2.
Syntax
double atan2(<expr1>, <expr2>)
Parameters
expr1: required. The value is of the DOUBLE type. If the input value is of the STRING, BIGINT, or DECIMAL type, the value is implicitly converted into a value of the DOUBLE type before calculation.
expr2: required. The value is of the DOUBLE type. If the input value is of the STRING, BIGINT, or DECIMAL type, it is implicitly converted into a value of the DOUBLE type before calculation.
Return value
A value of the DOUBLE type is returned. The return value ranges from -π/2 to π/2
. If the value of expr1 or expr2 is null, null is returned.
Examples
-- The value 0.0 is returned.
select atan2(0, 0);
Related functions
ATAN2 is a mathematical function. For more information about functions related to data computing and conversion, see Mathematical functions.