degrees() and radians() in Python

In this tutorial, you will learn about degrees() and radians() methods in Python. By using the math module the data will be change to degrees() and radians() in Python. For mathematical solving, ship direction, etc will be taken.

Degrees():

The degrees are unit of angle measure, all the angels are using degrees basically, you learn that circle contains 360 degrees like that it will be used.

The degree symbol will obtain by using Chr(176) method

Radian():

It is a unit of measure of angels in trigonometry it will use instead of degrees, whereas the circle contains only 360 degrees, a full circle is just over 6 radians. a full circle has 2 pi radians.

Diagram for Degree and Radian:

degrees() and radians() in Python

The above diagram will show the glance description of the Degrees and Radians.

Importing math module:

from the below code are used to import math module

import math

Program on Degrees and Radians in Python:

from the below code about Degrees and Radians:

import math
l=[1,2,3]
for i in range(len(l)):
    print(math.degrees(l[i]),"degrees")
    print(math.radians(l[i]),"radians")

Output:

57.29577951308232 degrees
0.017453292519943295 radians
114.59155902616465 degrees
0.03490658503988659 radians
171.88733853924697 degrees
0.05235987755982989 radians

Explanation

  • From the above code importing math module.
  • Consider a list having 3 elements by using the math module showing the degrees and radians values.
  • By using for loop the data will be shown in degrees and radians format.

References:

For further references about degrees and radians ->click here

Leave a Reply

Your email address will not be published.