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.

Parameters :
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.

 `# Python code to demonstrate` `# working of radians()` ` ` `# for radians` `import` `math` ` ` `# Printing radians equivalents.` `print``(``"180 / pi Degrees is equal to Radians : "``, end ``=``"")` `print` `(math.radians(``180` `/` `math.pi))` ` ` `print``(``"180 Degrees is equal to Radians : "``, end ``=``"")` `print` `(math.radians(``180``))` ` ` `print``(``"1 Degrees is equal to Radians : "``, end ``=``"")` `print` `(math.radians(``1``))`

Output:

```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
```
degrees()

This function accepts the “radians” as input and converts it into its degrees equivalent.

Parameters :
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()

 `# Python code to demonstrate` `# working of degrees()` ` ` `# for degrees()` `import` `math` ` ` `# Printing degrees equivalents.` `print``(``"pi / 180 Radians is equal to Degrees : "``, end ``=``"")` `print` `(math.degrees(math.pi ``/` `180``))` ` ` `print``(``"180 Radians is equal to Degrees : "``, end ``=``"")` `print` `(math.degrees(``180``))` ` ` `print``(``"1 Radians is equal to Degrees : "``, end ``=``"")` `print` `(math.degrees(``1``))`

Output:

```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
```

Application :
There are many possible applications of these functions in mathematical computations related to geometry and has a certain applications in astronomical computations as well.

Last Updated on October 29, 2021 by admin

Display the Pandas DataFrame in table styleDisplay the Pandas DataFrame in table style

Display the Pandas DataFrame in table style In this article, we’ll see how we can display a DataFrame in the form of a table with borders around rows and columns. It’s necessary to display the DataFrame in the form of

How to Run a Python Script using Docker?How to Run a Python Script using Docker?

How to Run a Python Script using Docker? Python is one of the most popular and widely used programming languages. Right from building a simple GUI app using Tkinter to building a full-fledged web application, Python is used everywhere. In

Python – Itertools Combinations() functionPython – Itertools Combinations() function

Python – Itertools Combinations() function Itertool is a module of Python which is used to creation of iterators which helps us in efficient looping in terms of space as well as time. This module helps us to solve complex problems easily

Python EncapsulationPython Encapsulation

Encapsulation in Python Encapsulation is one of the fundamental concepts in object-oriented programming (OOP). It describes the idea of wrapping data and the methods that work on data within one unit. This puts restrictions on accessing variables and methods directly

Convert date string to timestamp in PythonConvert date string to timestamp in Python

Convert date string to timestamp in Python The Most Common way we use to store dates and times into a Database is in the form of a timestamp. When we receive a date and time in form of a string

Python ModulesPython Modules

Python Modules A Python module is a file containing Python definitions and statements. A module can define functions, classes, and variables. A module can also include runnable code. Grouping related code into a module makes the code easier to understand

Python – Ways to remove a key from dictionaryPython – Ways to remove a key from dictionary

Python | Ways to remove a key from dictionary Dictionary is used in manifold practical applications such as day-day programming, web development and AI/ML programming as well, making it a useful container overall. Hence, knowing shorthands for achieving different tasks related