Return the turtle's current heading. No arguments. Example (for a Turtle instance named turtle): >>> turtle.left(67) >>> turtle.heading() 67.0
(self)
| 1894 | return (self._angleOffset + self._angleOrient*result) % self._fullcircle |
| 1895 | |
| 1896 | def heading(self): |
| 1897 | """ Return the turtle's current heading. |
| 1898 | |
| 1899 | No arguments. |
| 1900 | |
| 1901 | Example (for a Turtle instance named turtle): |
| 1902 | >>> turtle.left(67) |
| 1903 | >>> turtle.heading() |
| 1904 | 67.0 |
| 1905 | """ |
| 1906 | x, y = self._orient |
| 1907 | result = round(math.degrees(math.atan2(y, x)), 10) % 360.0 |
| 1908 | result /= self._degreesPerAU |
| 1909 | return (self._angleOffset + self._angleOrient*result) % self._fullcircle |
| 1910 | |
| 1911 | def setheading(self, to_angle): |
| 1912 | """Set the orientation of the turtle to to_angle. |