MySQL DEGREES() Function

The DEGREES() function in MySQL is used to convert a value in radians to degrees.


Syntax

DEGREES(number)

Definition and Usage

  • The DEGREES() function converts the numeric value from radians to degrees.
  • Formula: Degrees = Radians × (180 / π)

Parameter Values

Parameter Description
number Required. A numeric value in radians to be converted to degrees.

Technical Details

  • Works in: From MySQL 4.0
  • Result: Returns the value in degrees as a numeric value.

Examples

Example 1: Convert radians to degrees

SELECT DEGREES(1.5);

Result:

DEGREES(1.5): 85.9437

Explanation: The value 1.5 radians is converted to 85.9437 degrees.


Example 2: Convert the value of π * 2 radians to degrees

SELECT DEGREES(PI() * 2);

Result:

DEGREES(PI() * 2): 360

Explanation: The value of PI() * 2 radians (which equals ) is equivalent to 360 degrees.


Usage Notes

  • This function is helpful when working with trigonometric functions, as trigonometric functions in MySQL typically use radians.
  • If you have an angle in radians and need to convert it into degrees for interpretation, use the DEGREES() function.

The DEGREES() function is useful when dealing with angles in trigonometry and geometry, converting between the two standard units for measuring angles: radians and degrees.


Was this article helpful?