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

Python math.radians() Method

Python math.radians() Method

Python math Module Python math Module

Python math.radians(x) The method converts an angle x from degrees to radians.

math.degrees() The method converts a radian value to degrees.

Python version: 2.0

Syntax

The syntax of the math.radians() method is as follows:

math.radians(x)

Parameter Description:

Return Value

Returns a floating-point number representing a radian value.

Example

The following example converts different degree values to radians:

Example

Import the math package

import

math

Output the degree-to-radian conversions

print

(

math

.

radians

(

180

)

)

print

(

math

.

radians

(

100.03

)

)

print

(

math

.

radians

(

20

)

)

Output result:



3.141592653589793

1.7458528507699278

-0.3490658503988659

Python math Module Python math Module