SQL Server TAN() Function
The TAN()
function in SQL Server calculates the trigonometric tangent of a number. The input is an angle expressed in radians, and the output is the tangent of that angle.
TAN(): Definition and Usage
The tangent function is a fundamental trigonometric function frequently used in mathematical, scientific, and engineering calculations involving angles and triangles. In SQL Server, TAN()
provides a convenient way to perform these calculations directly within your queries.
Syntax
Syntax
TAN(number)
Parameter Values
Parameter | Description |
---|---|
number |
The angle in radians for which you want to calculate the tangent. This is required. |
Examples
Calculating the Tangent of a Positive Number
This example calculates the tangent of 1.75 radians.
Syntax
SELECT TAN(1.75);
Output
-1.02963856809667 (The exact value might vary slightly depending on your SQL Server version)
Calculating the Tangent of a Negative Number
This example calculates the tangent of -3 radians.
Syntax
SELECT TAN(-3);
Output
-0.142546543074278 (The exact value might vary slightly depending on your SQL Server version)
Technical Details
The TAN()
function is supported in:
- SQL Server (starting with version 2008)
- Azure SQL Database
- Azure SQL Data Warehouse
- Parallel Data Warehouse