Skip to content
Related Articles

Related Articles

Improve Article
Python – turtle.radians()
  • Last Updated : 18 Aug, 2020

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 :






# importing package
import turtle
  
# move as default in degrees
turtle.left(90)
  
# take value by heading
print(turtle.heading())
  
# set to radians
turtle.radians()
  
# agian take value by heading
print(turtle.heading())

Output :

90.0
1.5707963267948966

Example 2 :




# importing package
import turtle
  
# set to radians
turtle.radians()
  
# turn to left by 90
turtle.left(90)
  
# move forward by 100
turtle.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.

 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. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course




My Personal Notes arrow_drop_up
Recommended Articles
Page :