Python math.degrees() Method
Python math.degrees(x) The method converts an angle x from radians to degrees.
PI (3.14..) radians equals 180 degrees, which means 1 radian equals 57.2957795 degrees.
math.radians() The method converts a degree value to radians.
Python version: 2.3
Syntax
The syntax of the math.degrees() method is as follows:
math.degrees(x)
Parameter Description:
- x -- required, a number. If x is not a number, a TypeError is returned.
Return Value
Returns a floating-point number representing an angle.
Example
The following example converts different radian values to degrees:
Example
Import the math package
import
math
Output the radian-to-degree conversions
(
math
.
degrees
(
8.90
)
)
(
math
.
degrees
(
20
)
)
(
math
.
degrees
(
1
)
)
(
math
.
degrees
(
90
)
)
Output result:
509.9324376664327
-1145.9155902616465
57.29577951308232
5156.620156177409
Python math Module