Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python math.degrees() Method

Python math.degrees() Method

Python math Module Python math Module

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:

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

print

(

math

.

degrees

(

8.90

)

)

print

(

math

.

degrees

(

20

)

)

print

(

math

.

degrees

(

1

)

)

print

(

math

.

degrees

(

90

)

)

Output result:


509.9324376664327
-1145.9155902616465
57.29577951308232
5156.620156177409

Python math Module Python math Module