Set the orientation of the turtle to to_angle. Aliases: setheading | seth Argument: to_angle -- a number (integer or float) Set the orientation of the turtle to to_angle. Here are some common directions in degrees: standard - mode: logo-
(self, to_angle)
| 1976 | return (self._angleOffset + self._angleOrient*result) % self._fullcircle |
| 1977 | |
| 1978 | def setheading(self, to_angle): |
| 1979 | """Set the orientation of the turtle to to_angle. |
| 1980 | |
| 1981 | Aliases: setheading | seth |
| 1982 | |
| 1983 | Argument: |
| 1984 | to_angle -- a number (integer or float) |
| 1985 | |
| 1986 | Set the orientation of the turtle to to_angle. |
| 1987 | Here are some common directions in degrees: |
| 1988 | |
| 1989 | standard - mode: logo-mode: |
| 1990 | -------------------|-------------------- |
| 1991 | 0 - east 0 - north |
| 1992 | 90 - north 90 - east |
| 1993 | 180 - west 180 - south |
| 1994 | 270 - south 270 - west |
| 1995 | |
| 1996 | Example (for a Turtle instance named turtle): |
| 1997 | >>> turtle.setheading(90) |
| 1998 | >>> turtle.heading() |
| 1999 | 90 |
| 2000 | """ |
| 2001 | angle = (to_angle - self.heading())*self._angleOrient |
| 2002 | full = self._fullcircle |
| 2003 | angle = (angle+full/2.)%full - full/2. |
| 2004 | self._rotate(angle) |
| 2005 | |
| 2006 | def circle(self, radius, extent = None, steps = None): |
| 2007 | """ Draw a circle with given radius. |