degress() and radians() are methods specified in math module in Python 3 and Python 2.
Often one is in need to handle mathematical computation of conversion of radians to degrees and vice-versa, especially in the field of geometry. Python offers inbuilt methods to handle this functionality. Both the functions are discussed in this article.
This function accepts the “degrees” as input and converts it into its radians equivalent.
Syntax : radians(deg)
deg : The degrees value that one needs to convert into radians
Returns : This function returns the floating point radians equivalent of argument.
Computational Equivalent : 1 Radians = 180/pi Degrees.
Code #1 : Demonstrating radians()
180/pi Degrees is equal to Radians : 1.0 180 Degrees is equal to Radians : 3.141592653589793 1 Degrees is equal to Radians : 0.017453292519943295
This function accepts the “radians” as input and converts it into its degrees equivalent.
Syntax : degrees(rad)
rad : The radians value that one needs to convert into degrees.
Returns : This function returns the floating point degrees equivalent of argument.
Computational Equivalent : 1 Degrees = pi/180 Radians.
Code #2 : Demonstrating degrees()
pi/180 Radians is equal to Degrees : 1.0 180 Radians is equal to Degrees : 10313.240312354817 1 Radians is equal to Degrees : 57.29577951308232
There are many possible applications of these functions in mathematical computations related to geometry and has a certain applications in astronomical computations as well.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Convert angles from degrees to radians for all elements in a given NumPy array
- Convert angles from radians to degrees in a NumPy array
- numpy.radians() and deg2rad() in Python
- Python - turtle.radians()
- numpy.degrees() and rad2deg() in Python
- turtle.degrees() function in Python
- Important differences between Python 2.x and Python 3.x with examples
- Creating and updating PowerPoint Presentations in Python using python - pptx
- Loops and Control Statements (continue, break and pass) in Python
- Python counter and dictionary intersection example (Make a string using deletion and rearrangement)
- Python | Using variable outside and inside the class and method
- Releasing GIL and mixing threads from C and Python
- Python | Boolean List AND and OR operations
- Difference between 'and' and '&' in Python
- Replace the column contains the values 'yes' and 'no' with True and False In Python-Pandas
- Ceil and floor of the dataframe in Pandas Python – Round up and Truncate
- Login Application and Validating info using Kivy GUI and Pandas in Python
- Get the city, state, and country names from latitude and longitude using Python
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.