Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. import turtle
  2. import math
  3.  
  4. turtle.shape('turtle')
  5.  
  6. def RerPolygon(r,n):
  7.         b = 180*(1-2/n)
  8.         turtle.right(180-b/2)
  9.         a = 2*r*math.sin(math.pi/n)
  10.        
  11.         for i in range(n):
  12.             turtle.forward(a)
  13.             turtle.right(180-b)
  14. r = 10
  15. n = 3
  16. step = 0
  17.  
  18. for i in range (10):
  19.     turtle.penup()
  20.     turtle.seth(90)
  21.     turtle.forward(step)
  22.     turtle.pendown()
  23.     RerPolygon(r, n)
  24.    
  25.     n += 1
  26.     step += 5
  27.     r += step
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement