In SQL, the RADIANS() convert a degree value into radians.
SQL RADIANS()
SQL RADIANS() is a. built-in function that is used for converting the angle in the degree to approximate angle measured in radians. SQL ROUND() function rounds the number to a particular number of decimal places. It returns a numeric value, rounded to the specified length or precision.
Syntax
Select Radians (Number);
Parameters
Number: The angle in degree whose angle in radians is to be calculated. It can be an expression of any numeric data type category, except for the bit data type.
Formula
Degrees*π/180 = X radians.
Examples
Query 1
Select Radians (180);
Output
3
Explanation
Here, 180 represented in degree gets converted to its equivalent radians.
Query 2
Select Radians (180.0);
Output
3.141592653589793116
Explanation
Here, 180 represented in degree gets converted to its equivalent radians. The result from the above example was different as the degree was expressed in the form of fractions.
Query 3
Select Radians (-45);
Output
-0.7853981633974483
Explanation
Here, -45 degrees represented in degree gets converted to its equivalent radians. Result returned was negative because the degree was also represented in negative form.
Query 4
Select Radians (0);
Output
0
Explanation
The value of 0 in degree is similar to its value in radians.
Query 5
Select Radians (45*4);
Output
3
Explanation
The above expression is similar to 180 degrees as (45*4) results are the same expression.