Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_spiralpowered.py
- from Tkinter import *
- from PIL import Image, ImageTk
- import random
- import math
- import time
- ww = 500
- hh = 500
- root = Tk()
- root.title("Tk Spiral")
- root.geometry("%dx%d+-10+0"%(ww,hh))
- canvas = Canvas(root, width=ww, height=hh)
- canvas.pack()
- xy = []
- PI = math.pi
- ww0 = ww/2
- hh0 = hh/2
- for i in range(500):
- t = i / 20.0 * PI
- d = i*0.1+i**(0.002*i)
- x = ww0 + d * math.cos(i/5.0)
- y = hh0 + d * math.sin(i/5.0)
- xy.append((x,y))
- canvas.create_line(xy, fill="purple", width=3)
- canvas.update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement