Saturday, July 19, 2025
HomeLanguagesPython – turtle.radians()

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 package
import turtle
 
# move as default in degrees
turtle.left(90)
 
# take value by heading
print(turtle.heading())
 
# set to radians
turtle.radians()
 
# again take value by heading
print(turtle.heading())


Output : 

90.0
1.5707963267948966

Example 2 : 

python3




# 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.

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32154 POSTS0 COMMENTS
Milvus
67 POSTS0 COMMENTS
Nango Kala
6529 POSTS0 COMMENTS
Nicole Veronica
11677 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11737 POSTS0 COMMENTS
Shaida Kate Naidoo
6623 POSTS0 COMMENTS
Ted Musemwa
6899 POSTS0 COMMENTS
Thapelo Manthata
6590 POSTS0 COMMENTS
Umr Jansen
6583 POSTS0 COMMENTS