MySQL DEGREES() Function
In MySQL, the DEGREES()
function converts a value from radians to degrees and return the result.
If you need to convert degrees to radians, use the RADIANS()
function . See also PI()
functions .
DEGREES()
Syntax
Here is the syntax of MySQL DEGREES()
function:
DEGREES(number)
Parameters
number
- Required. An angle, in radians.
Return value
In MySQL, the DEGREES()
function converts a value from radians to degrees and return the result.
If the parameter number
is NULL
, the DEGREES()
function will return NULL
.
DEGREES()
Examples
SELECT
DEGREES(1.25),
DEGREES(0.75),
DEGREES(-1.25),
DEGREES(-0.75),
DEGREES(0),
DEGREES(PI()),
DEGREES(PI() * 2),
DEGREES(PI() * 3),
DEGREES(PI() * -1),
DEGREES(NULL)\G
output
*************************** 1\. row ***************************
DEGREES(1.25): 71.6197243913529
DEGREES(0.75): 42.97183463481174
DEGREES(-1.25): -71.6197243913529
DEGREES(-0.75): -42.97183463481174
DEGREES(0): 0
DEGREES(PI()): 180
DEGREES(PI() * 2): 360
DEGREES(PI() * 3): 540
DEGREES(PI() * -1): -180
DEGREES(NULL): NULL