DEGREES
DEGREES is a mathematical function in SQL used to convert radians into degrees.
DEGREES(angle)
- angle: This parameter represents a numeric value that specifies the radians. It is the radian value that will be converted into degrees by the DEGREES() function.
Example
Output
Explanation
The DEGREES()
function in MySQL is used to convert the specified radian value into degrees. In this example, PI()
, a function that returns the value of PI, is passed as a parameter to the DEGREES()
function. Since the PI radian equals 180 degrees, the function returns 180
.
DEGREES( numeric_expression )
- numeric_expression: A numeric expression that includes the angle in radians for which to return the degrees. This can be an expression of the exact numeric or approximate numeric data type category, excluding the bit data type.
Example
Output
Explanation
The DEGREES
function in SQL Server converts a value in radians to degrees. In the example, the approximation of pi (3.14159) is converted to approximately 180 degrees.
DEGREES(number)
- number: This is a numeric value (in radians) which we want to convert to degrees.
Example
Output
Explanation
The DEGREES
function is used to convert radians to degrees. So, 0.5 radians is approximately 28.65 degrees.