Easy Tutorial
❮ Python List Operator Python Get Yesterday ❯

Python3 radians() Function

Python3 Numbers


Description

The radians() method converts degrees to radians.

The relationship between degrees and radians is: 2π radians = 360°. Therefore, 1° ≈ 0.0174533 radians, and 1 radian ≈ 57.29578°.

Syntax

Here is the syntax for the radians() method:

import math

math.radians(x)

Note: The radians() method cannot be accessed directly; it requires importing the math module and then calling this method via the math static object.


Parameters


Return Value

Returns the radian value of the angle.


Example

Below are examples of using the radians() method:

#!/usr/bin/python3
import math

print("radians(90) : ", math.radians(90))  # 1 radian is approximately 57.3°
print("radians(45) : ", math.radians(45))
print("radians(30) : ", math.radians(30))
print("radians(180) : ", math.radians(180))  # 180 degrees is π radians

print("180 / pi : ", end="")
print(math.radians(180 / math.pi))

The output of the above examples is:

radians(90) :  1.5707963267948966
radians(45) :  0.7853981633974483
radians(30) :  0.5235987755982988
radians(180) :  3.141592653589793
180 / pi : 1.0

Python3 Numbers

❮ Python List Operator Python Get Yesterday ❯