Return the turtle's current heading. No arguments. Example (for a Turtle instance named turtle): >>> turtle.left(67) >>> turtle.heading() 67.0
(self)
| 1792 | return (self._angleOffset + self._angleOrient*result) % self._fullcircle |
| 1793 | |
| 1794 | def heading(self): |
| 1795 | """ Return the turtle's current heading. |
| 1796 | |
| 1797 | No arguments. |
| 1798 | |
| 1799 | Example (for a Turtle instance named turtle): |
| 1800 | >>> turtle.left(67) |
| 1801 | >>> turtle.heading() |
| 1802 | 67.0 |
| 1803 | """ |
| 1804 | x, y = self._orient |
| 1805 | result = round(math.atan2(y, x)*180.0/math.pi, 10) % 360.0 |
| 1806 | result /= self._degreesPerAU |
| 1807 | return (self._angleOffset + self._angleOrient*result) % self._fullcircle |
| 1808 | |
| 1809 | def setheading(self, to_angle): |
| 1810 | """Set the orientation of the turtle to to_angle. |