MySQL DEGREES() Function
The DEGREES()
function in MySQL converts an angle from radians to degrees. This is a fundamental mathematical function used in trigonometry and other calculations involving angles.
DEGREES(): Definition and Usage
Radians and degrees are two different units for measuring angles. Radians are based on the radius of a circle (2π radians equals 360 degrees), while degrees divide a circle into 360 equal parts. The DEGREES()
function is essential for converting results from calculations (or data stored in your database) that use radians into the more familiar degree format.
Syntax
Syntax
DEGREES(number)
Parameter Values
Parameter | Description |
---|---|
number |
The angle measured in radians. This is required and must be a numeric value. |
Related Functions
For converting degrees to radians, see the RADIANS()
function. The PI()
function returns the value of pi (π), which is frequently used in trigonometric calculations.
Examples
Converting Radians to Degrees
This example converts 1.5 radians to degrees.
Syntax
SELECT DEGREES(1.5);
Output
85.9436692696235
Converting 2π Radians to Degrees
This shows that 2π radians equals 360 degrees.
Syntax
SELECT DEGREES(PI() * 2);
Output
360.000000000000