Python math.radians() Function

Beginner
5 min read
Updated: Nov 2026
3 examples
math module

Definition

math.radians(x) converts an angle x from degrees to radians using x * (pi / 180) and returns a float.

Every trigonometric function in Python's math module (math.sin(), math.cos(), math.tan()) expects radians, so call math.radians() whenever your inputs start in degrees.

math.radians() is a function in Python's standard math module: import it with import math and call math.radians(...), or import the name directly with from math import radians.

Syntax

Import math and pass an angle in degrees.

python
import math

rad = math.radians(angle_degrees)
CallWhat it does
math.radians(180)Returns 3.141592653589793 (math.pi).
math.radians(90)Returns approximately 1.570796... (pi / 2).
math.radians(0)Returns 0.0.
math.radians(-45)Returns approximately -0.785398... (-pi / 4).

Converts proportionally without wrapping: math.radians(720) gives 2 * math.tau. Use math.degrees() to convert back.

Function signatures
python
math.radians(x, /)
# returns: float angle in radians (x * pi / 180)

Parameters

ParameterDescription
xRequired positional angle in degrees (int or float).

Return Value

Return ValueDescription
floatEquivalent angle in radians; returns inf, -inf, or nan for special floats.

Python Examples

Example 1 — Feed Degree Measurements Into sin() and cos()

Convert common compass degrees to radians and evaluate cosine and sine side by side.

python
import math

for deg in [0, 45, 90, 180]:
    r = math.radians(deg)
    c, s = math.cos(r), math.sin(r)
    print(
        f"{deg:>3} deg | rad={r:.4f} | "
        f"cos={c:+.4f} | sin={s:+.4f}"
    )

How It Works

  1. Convert once per angle. Storing r = math.radians(deg) lets both math.cos() and math.sin() reuse the radian angle.
  2. 45-degree symmetry. Sine and cosine meet at 0.7071 (sqrt(2) / 2) at 45 degrees.
  3. Clean unit values. At 0, 90, and 180 degrees, four-decimal formatting yields 1.0000, 0.0000, and -1.0000.

Example 2 — Compute Pizza Slice Arc Length From Degree Angle

Multiply circle radius by math.radians(slice_deg) to measure curved rim length.

python
import math

radius_cm = 15.0
for slice_deg in [30, 45, 60, 90]:
    arc_cm = radius_cm * math.radians(slice_deg)
    print(f"{slice_deg} deg slice -> arc {arc_cm:.2f} cm")

How It Works

  1. Radian arc formula. Circular arc length is simply r * theta when theta is in radians.
  2. Proportional rims. A 60-degree slice covers roughly 15.71 cm, slightly more than the 15 cm radius.
  3. Quarter pie check. Ninety degrees produces pi / 2 * 15 = 23.56 cm.

Example 3 — Verify radians(180) == pi and Round-Trip With degrees()

Confirm math.radians(180) equals math.pi and round-trip fractional degrees.

python
import math

print(math.radians(180) == math.pi)
print(math.radians(360) == math.tau)
print(math.isclose(math.degrees(math.radians(137.5)), 137.5))
print(f"{math.radians(-90):.4f}")

How It Works

  1. Exact pi constants. Converting 180 gives math.pi and 360 gives math.tau exactly.
  2. Round-trip golden angle. Converting 137.5 to radians and back matches via math.isclose().
  3. Negative angles keep sign. Minus ninety degrees returns -1.5708 radians.

Frequently Asked Questions

It multiplies degrees by math.pi / 180.0 and returns a float.
Radians follow the natural mathematical definitions where arc length equals radius * angle and derivatives of sin/cos have unit scale.
Yes, math.radians(180) == math.pi is True.
It scales proportionally without wrapping: math.radians(-90) is -pi/2 and math.radians(720) is 4*pi.
Call math.degrees(rad).

Next: math.remainder()

Return the IEEE 754 remainder of x with respect to y.

remainder() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful