The math.radians() method is used to convert a degree value into radians.
The conversion formula is radians = degrees * (π / 180).
Syntax
math.radians(degrees)
Parameter
degrees(required): An angle in degrees that you want to convert to radians.
Return value
It returns the value of an angle in radians as a float.
If the input value is not a number , it returns TypeError.
Visual Representation
Example: How to Use math.radians() Method
import math
# Convert degrees to radians
print(math.radians(90))
print(math.radians(180))
print(math.radians(-90))
print(math.radians(47.75))
Output
1.5707963267948966
3.141592653589793
-1.5707963267948966
0.8333947178272924
That’s it.
Ankit Lathiya is a Master of Computer Application by education and Android and Laravel Developer by profession and one of the authors of this blog. He is also expert in JavaScript and Python development.