Last Updated : 11 Jul, 2025
In geometry and trigonometry, we often switch between degrees and radians. Python’s math module provides two simple functions to handle these conversions:
Let’s explore both with examples:
math.radians()This function takes a degree value and returns its equivalent in radians.
Syntaxmath.radians(x)
Parameters:
Returns: Angle in radians (float)
Example 1: Convert Degrees to Radians Python
import math
x = 180
print("Radians:", math.radians(x))
Radians: 3.141592653589793
Explanation: 180 degrees is exactly π radians.
Example 2: Convert 1 Degree and Fractional Degree Python
import math
a = 1
b = 180 / math.pi
print("1° in Radians:", math.radians(a))
print("180/π° in Radians:", math.radians(b))
1° in Radians: 0.017453292519943295 180/π° in Radians: 1.0
Explanation: 180/π degrees equals exactly 1 radian.
math.degrees()This function takes a radian value and returns its equivalent in degrees.
Syntaxmath.degrees(x)
Parameters:
Returns: Angle in degrees (float)
Example 3: Convert Radians to Degrees Python
import math
x = math.pi
print("Degrees:", math.degrees(x))
Explanation: π radians is exactly 180 degrees.
Example 4: Convert 1 Radian and π/180 Radians Python
import math
a = 1
b = math.pi / 180
print("1 Radian in Degrees:", math.degrees(a))
print("π/180 Radians in Degrees:", math.degrees(b))
Explanation: 1 radian ≈ 57.3°, and π/180 radians equals 1 degree.
ApplicationsRelated Articles:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4