Python Math radians() Method
The Python Math radians() method converts angles to radians.
The relationship between angle and radian is: 2π radians = 360°. Thus, 1° ≈ 0.0174533 radians and 1 radian ≈ 57.29578°.
- Angle to radian conversion formula: radian = angle ÷ 180 × π
- The formula for converting radians to angles: Angle = radians × 180 ÷ π
Python Math radians() Syntax
Here is the syntax of the radians() method:
import math
math.radians(x)
Note: radians() is not directly accessible, you need to import the math module and then call the method via the math static object.
Python Math radians() Parameters
- x : An angle value, the default unit is angle °.
Python Math radians() Return Value
Returns the radian value of an angle.
Python Math radians() Example#1
The following shows an example of using the radians() method.
#!/usr/bin/python3
import math
print ("radians(800) : ", math.radians(800)) # 1 radian equals approximately 57.3°
print ("radians(69) : ", math.radians(60))
print ("radians(30) : ", math.radians(30))
print ("radians(180) : ", math.radians(180)) # The radian of 180 degrees is π
print("180 / pi : ", end ="")
print (math.radians(180 / math.pi))
Output: