math.degrees()
Anonymous contributor
Anonymous contributor2 total contributions
Anonymous contributor
Published Aug 22, 2024
Contribute to Docs
In Python, the math.degrees()
function takes an angle measured in radians and returns its degree equivalent as a floating-point value.
Syntax
math.degrees(x)
x
: A numeric value or expression representing an angle in radians. If it is not a number, the function will raise aTypeError
.
Here is an image that illustrates some common degree-radian equivalencies:
Example 1
In the example below, the math.degrees()
function returns the degree equivalent of π
:
import mathpi = math.piprint(math.degrees(pi))
The above code gives the following output:
180.0
Example 2
In the following example, the math.degrees()
function returns the degree equivalent of 1
radian:
import mathprint(math.degrees(1.0))
The above code produces the following output:
57.29577951308232
Codebyte Example
The following codebyte example demonstrates how the math.degrees()
function works:
All contributors
- Anonymous contributorAnonymous contributor2 total contributions
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.