DEGREES() and RADIANS() Function in SQL Server
1. DEGREES() Function :
The DEGREES() function converts a value in radians to degrees.
Syntax :
DEGREES(number)
Parameter : Required. A numeric value.
number : It is a numeric value.
Returns : It returns a value whose data type matches the data type of numeric_expression.
Example-1 :
Converts a radian value into degrees.
SELECT DEGREES(1);
Output :
57
Example-2 :
When the argument holds a fraction.
SELECT DEGREES(2.7);
Output :
154.698604685322294472
Example-3 :
When the PI() function is the argument.
SELECT DEGREES(PI());
Output :
180.0
Example-4 :
When the argument passed is an expression.
SELECT DEGREES(PI() / 4);
Output :
45.0
2. RADIANS() Function :
The RADIANS() function converts a degree value into radians.
Syntax :
RADIANS(number)
Parameter : Required. A numeric value.
number : It is a number in degrees.
Returns : It returns the same type as numeric_expression.
Example-1 :
Converts a degree value into radians.
SELECT RADIANS(180);
Output :
3
Example-2 :
When the argument holds a fraction.
SELECT RADIANS(180.0);
Output :
3.141592653589793116
Example-3 :
When the argument holds a negative value.
SELECT RADIANS(-180);
Output :
-3
Example-4 :
When the argument passed is an expression.
SELECT RADIANS(180 / 3);
Output :
1
Contact Us