| | |
| | | self.setheading(head) |
| | | pass |
| | | |
| | | def pentagon(self, length, x, y): |
| | | alpha = 72 |
| | | self.teleport(x, y) |
| | | |
| | | def __regular_polygon(self, corner_number, length, x, y): |
| | | alpha = 360 / corner_number |
| | | head = self.heading() |
| | | for i in range(0, 5): |
| | | for i in range(0, corner_number): |
| | | self.forward(length) |
| | | self.left(alpha) |
| | | self.setheading(head) |
| | | pass |
| | | |
| | | |
| | | def pentagon(self, length, x, y): |
| | | self.__regular_polygon(6, length, x, y) |
| | | pass |
| | | |
| | |
| | | from turtle import Turtle |
| | | from random import random |
| | | |
| | | from turtlegeo.TtGeo import TtGeo |
| | | |
| | | |
| | |
| | | t.triangle(50, 20, 25) |
| | | t.pentagon(60, 20, 25) |
| | | |
| | | |
| | | t.screen.mainloop() |