SQL ATAN() Function Example | atan() in SQL
SQL ATAN() is an inbuilt function that is used for finding the arctangent of a number, i.e., it returns angle, in radians, whose tangent is a specified float expression. The SQL ATAN() function returns the arctangent of a value. In other words, it returns the angle, in radians, whose tangent is a specified float expression.
SQL ATAN()
SQL ATAN() function returns the arctangent of a number.
Syntax
SELECT ATAN (Expression); OR SELECT ATAN (A, B);
Parameters
- Float_expression: An expression of float or any other type which is implicitly converted to float whose arc tangent value is to be retrieved.
- A, B: Two values whose arctangent value is to be calculated.
Examples
Query 1
SELECT ATAN (2.5);
Output
1.1902899496825317
Explanation
Here, the arctangent value is returned.
Query 2
SELECT ATAN (1.3)
Output
0.91510070055336
Explanation
Here, the arctangent value is returned.
Query 3
SELECT ATAN (-1.3);
Output
-0.91510070055336
Explanation
Here, arctangent value is returned which is negative.
Query 4
SELECT ATAN (2.5 + 0.3);
Output
1.22777238637419
Explanation
Here, the arc tangent value of the expression is returned.
Query 5
SELECT ATAN (NULL);
Output
NULL
Explanation
Passing of NULL value as an argument will return a NULL value.