math.radians
Convert an angle from degrees to radians.
Python 3.13
math.radians(x)Parameters
- xint | float
- The angle in degrees.
Return value
The angle in radians as a float.
Examples
Converting 180 degrees to radians
Python 3.13
import math
print(math.radians(180))3.141592653589793
Sine of a 90-degree angle
Python 3.13
import math
print(math.sin(math.radians(90)))1.0
Details
The trigonometric functions of the math module take an angle in radians, so degrees are converted with radians first. The inverse function is math.degrees.
