Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle
- from math import sin
- from math import pi
- def polygon():
- for i in range(x):
- turtle.forward(y)
- turtle.left(360 / x)
- turtle.shape('turtle')
- x = 3
- r = 15
- y = r * (2 * sin(pi / x))
- h = 10
- for i in range(10):
- polygon()
- turtle.right(360 / x + 0.5 * (180 - 360 / x))
- turtle.penup()
- turtle.forward(h)
- turtle.pendown()
- x += 1
- turtle.left(90 + 0.5 * 360 / x)
- r += h
- y = r * (2 * sin(pi / x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement