Python math.radians()

Anonymous contributor's avatar
Anonymous contributor
Published Aug 26, 2024

In Python, the math.radians() function takes an angle measured in degrees and returns its radian equivalent as a floating-point value.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.
    • With Certificate
    • Beginner Friendly.
      24 hours

Syntax

math.radians(x)
  • x: A numeric value or expression representing an angle measured in degrees.

Here is an image illustrating some common degree-radian equivalencies:

"45 degree rotations expressed in radian measure" by Adrignola

Example 1

In the example below, the math.radians() function returns the radian equivalent of 180 degrees:

import math
print(math.radians(180))

The above code gives the following output:

3.141592653589793

Example 2

In the following example, the math.radians() function returns the radian equivalent of 57.29577951308232 degrees:

import math
print(math.radians(57.29577951308232))

The above code produces the following output:

1.0

Codebyte Example

The below codebyte example demonstrates how the math.radians() function works:

Code
Output

All contributors

Learn Python on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.
    • With Certificate
    • Beginner Friendly.
      24 hours