Python math.radians() Method

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

Visual Representation of Python math.radians() Method

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.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.