Python – turtle.radians()
Last Updated :
07 Oct, 2021
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
import turtle
turtle.left( 90 )
print (turtle.heading())
turtle.radians()
print (turtle.heading())
|
Output :
90.0
1.5707963267948966
Example 2 :
python3
import turtle
turtle.radians()
turtle.left( 90 )
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.
Share your thoughts in the comments
Please Login to comment...