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
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.