@@ -1580,7 +1580,7 @@ def reset(self):
1580
1580
Will be overwritten by parent class
1581
1581
"""
1582
1582
self ._position = Vec2D (0.0 , 0.0 )
1583
- self ._orient = TNavigator .START_ORIENTATION [self ._mode ]
1583
+ self ._orient = TNavigator .START_ORIENTATION [self ._mode ]
1584
1584
1585
1585
def _setmode (self , mode = None ):
1586
1586
"""Set turtle-mode to 'standard', 'world' or 'logo'.
@@ -1612,9 +1612,8 @@ def degrees(self, fullcircle=360.0):
1612
1612
Optional argument:
1613
1613
fullcircle - a number
1614
1614
1615
- Set angle measurement units, i. e. set number
1616
- of 'degrees' for a full circle. Default value is
1617
- 360 degrees.
1615
+ Set angle measurement units so that a full circle is *fullcircle*
1616
+ units. The default value is `360.0` (i.e. conventional degrees).
1618
1617
1619
1618
Example (for a Turtle instance named turtle):
1620
1619
>>> turtle.left(90)
@@ -1627,12 +1626,20 @@ def degrees(self, fullcircle=360.0):
1627
1626
>>> turtle.heading()
1628
1627
100
1629
1628
1629
+ Change angle measurement unit to radians (where a full circle
1630
+ equals 2π radians, so 90 degrees becomes π/2 radians)
1631
+ >>> turtle.degrees(2*math.pi)
1632
+ >>> turtle.heading()
1633
+ 1.5707963267948966
1634
+
1630
1635
"""
1631
1636
self ._setDegreesPerAU (fullcircle )
1632
1637
1633
1638
def radians (self ):
1634
1639
""" Set the angle measurement units to radians.
1635
1640
1641
+ Equivalent to calling `degrees(2*math.pi)`
1642
+
1636
1643
No arguments.
1637
1644
1638
1645
Example (for a Turtle instance named turtle):
@@ -1716,9 +1723,17 @@ def right(self, angle):
1716
1723
Argument:
1717
1724
angle -- a number (integer or float)
1718
1725
1719
- Turn turtle right by angle units. (Units are by default degrees,
1720
- but can be set via the degrees() and radians() functions.)
1721
- Angle orientation depends on mode. (See this.)
1726
+ Turn turtle right by *angle* units.
1727
+
1728
+ The unit of measurement is controlled by `degrees()` and
1729
+ `radians()`:
1730
+
1731
+ * By default, 360.0 units form a full circle (degrees).
1732
+ * After calling `radians()`, ``2*math.pi`` units form a full circle.
1733
+ * Custom values can be set with `degrees(fullcircle)`.
1734
+
1735
+ Orientation of the turn depends in the current turtle mode,
1736
+ see function `mode()`.
1722
1737
1723
1738
Example (for a Turtle instance named turtle):
1724
1739
>>> turtle.heading()
@@ -1737,9 +1752,17 @@ def left(self, angle):
1737
1752
Argument:
1738
1753
angle -- a number (integer or float)
1739
1754
1740
- Turn turtle left by angle units. (Units are by default degrees,
1741
- but can be set via the degrees() and radians() functions.)
1742
- Angle orientation depends on mode. (See this.)
1755
+ Turn turtle left by *angle* units.
1756
+
1757
+ The unit of measurement is controlled by `degrees()` and
1758
+ `radians()`:
1759
+
1760
+ * By default, 360.0 units form a full circle (degrees).
1761
+ * After calling `radians()`, ``2*math.pi`` units form a full circle.
1762
+ * Custom values can be set with `degrees(fullcircle)`.
1763
+
1764
+ Orientation of the turn depends in the current turtle mode,
1765
+ see function `mode()`.
1743
1766
1744
1767
Example (for a Turtle instance named turtle):
1745
1768
>>> turtle.heading()
@@ -2622,8 +2645,27 @@ def reset(self):
2622
2645
2623
2646
No argument.
2624
2647
2625
- Delete the turtle's drawings from the screen, re-center the turtle
2626
- and set variables to the default values.
2648
+ Delete the turtle's drawings from the screen. Move the turtle
2649
+ to position `(0, 0)`, set its heading to the default
2650
+ (facing east in standard mode) and restore the following state
2651
+ variables to their initial values:
2652
+
2653
+ - position: `(0, 0)`
2654
+ - heading: `0` (east)
2655
+ - pen state: down (drawing)
2656
+ - pensize: `1`
2657
+ - pencolor: black
2658
+ - fillcolor: white
2659
+ - speed: `3`
2660
+ - turtle visibility: shown
2661
+ - shape size: `(1.0, 1.0)` (no stretch)
2662
+ - shape shear: `0.0` (no shear)
2663
+ - shape tilt: `0.0` (no tilt)
2664
+
2665
+ Note:
2666
+ The angle unit is **not reset** to degrees. If
2667
+ `radians()` was used before `reset()`,
2668
+ the unit remains radians.
2627
2669
2628
2670
Example (for a Turtle instance named turtle):
2629
2671
>>> turtle.position()
0 commit comments