Python – turtle.radians()

The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
turtle.radians()
This method is used to set the angle measurement units to radians. It doesn’t require any argument. By default the angle measurement unit is “degrees”.
Syntax : turtle.radians()
Parameter : None
Returns : None
Below is the implementation of above method with some examples :
Example 1 :
python3
# importing packageimport turtle# move as default in degreesturtle.left(90)# take value by headingprint(turtle.heading())# set to radiansturtle.radians()# again take value by headingprint(turtle.heading()) |
Output :
90.0 1.5707963267948966
Example 2 :
python3
# importing packageimport turtle# set to radiansturtle.radians()# turn to left by 90turtle.left(90)# move forward by 100turtle.forward(100) |
Output :
If the measurement unit is in degrees than it give shape turn to left by 90 degrees and a forward by 100. But after setting measurement unit to radians it is clearly see that it move to 90 radians = 5156.62 degrees (14 x 360 + 116.62) than a forward by 100 units.




