Python math.radians() - Convert Degrees to Radians


Python math.radians()

math.radians(x) function converts x degrees into radians and returns the radians.

Syntax

The syntax to call radians() function is

math.radians(x)

where

ParameterRequiredDescription
xYesA numeric value that represents angle in degrees.

Examples

In the following example, we convert 60 degrees into radians, using radians() function of math module.

Python Program

import math

x = 60 #degrees
result = math.radians(x)
print('radians(x) :', result)

Output

radians(x) : 1.0471975511965976

Now, let us convert one degree into radians.

Python Program

import math

x = 1 #degrees
result = math.radians(x)
print('radians(x) :', result)

Output

radians(x) : 0.017453292519943295

Summary

In this Python Examples tutorial, we learned the syntax of, and examples for math.radians() function.