ATAN() Function in SQL Server
ATAN() function :
This function in SQL Server is used to return the arc tangent or the inverse tangent of a specified value. This function accepts only one parameter which is a number and the range accepted for the argument number is unbounded.
This function returns a value in the range of -pi/2 to pi/2, expressed in radians. This function takes as an argument any numeric data type as well as any non-numeric data type that can be implicitly converted to a numeric data type.
Features :
- This function is used to find the arc tangent or the inverse tangent of a specified value.
- This function accepts a single parameter.
- The range of accepted parameter is unbounded.
- This function gives a value in the range of -pi/2 to pi/2.
- The returned value will be in radians.
Syntax :
SELECT ATAN(number);
Parameter :
This method accepts a parameter as given below:
- number: Specified numeric value whose inverse tangent is going to be returned.
Returns :
It returns the arc tangent or the inverse tangent of a specified value.
Example-1 :
Getting the inverse tangent of a specified value -1
SELECT ATAN(-1);
Output :
-0.78539816339744828
Example-2 :
Getting the inverse tangent of a specified value 45
SELECT ATAN(45);
Output :
1.5485777614681775
Example-3 :
Using ATAN() function with a variable and getting the inverse tangent of a specified value 0.
DECLARE @Parameter_Value INT; SET @Parameter_Value = 0; SELECT ATAN(@Parameter_Value);
Output :
0.0
Example-4 :
Using ATAN() function with a variable and getting the inverse tangent of a specified float value “0.45”.
DECLARE @Parameter_Value float; SET @Parameter_Value = 0.45; SELECT ATAN(@Parameter_Value);
Output :
0.42285392613294071
Application :
This function is used to return the arc tangent or the inverse tangent of a specified value.