SQL Server ATAN() Function
The ATAN()
function in SQL Server calculates the arctangent (inverse tangent) of a number. The arctangent is the angle whose tangent is the given number. The result is expressed in radians.
ATAN(): Definition and Usage
This function is primarily used in mathematical and geometrical computations. It's the inverse of the TAN()
function; given the tangent of an angle, ATAN()
returns the angle itself.
Syntax
Syntax
ATAN(number)
Parameter Values
Parameter | Description |
---|---|
number |
The numeric value for which you want to calculate the arctangent. This is required. The result will be in radians. |
Examples
Calculating the Arctangent of a Positive Number
This example finds the arctangent of 2.5.
Syntax
SELECT ATAN(2.5);
Output
1.19028994968263 (The exact value may vary slightly depending on your SQL Server version)
Calculating the Arctangent of a Negative Number
This example shows the arctangent of -45.01.
Syntax
SELECT ATAN(-45.01);
Output
-1.55987679578246 (The exact value may vary slightly depending on your SQL Server version)
Technical Details
The ATAN()
function is supported in:
- SQL Server (starting with version 2008)
- Azure SQL Database
- Azure SQL Data Warehouse
- Parallel Data Warehouse