Python math.radians() function
The math.radians()
function in Python is used to convert an angle from degrees to radians. This is useful in various mathematical calculations, especially in trigonometry, where angles are often required in radians.
Syntax
x
: The angle in degrees that you want to convert to radians.
Return Value
- Returns the angle in radians as a float.
Examples
Converting degrees to radians:
Converting a smaller angle:
Converting a negative angle:
Using
math.radians()
in expressions: You can combinemath.radians()
with other calculations:
Summary
- The
math.radians()
function converts an angle from degrees to radians. - The output is always a float.
- This function is particularly useful in trigonometric calculations where radians are the standard unit for angles in Python’s math library.