-
Notifications
You must be signed in to change notification settings - Fork 0
/
ngone.py
46 lines (33 loc) · 1.12 KB
/
ngone.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from tkinter import *
from math import *
global x
root = Tk()
canvas = Canvas(root, width=root.winfo_screenwidth(), height=root.winfo_screenheight())
ngone = int()
x=0
speed = int( )
coords = []
canvas.pack()
typedepoly = Scale(root,orient='horizontal', from_=3, to=22, length=300, variable=ngone, label = "nombre d'angles")
typedepoly.place(x=800,y=200)
#vitesse = Scale(root, showvalue = 0, orient='vertical', from_=, to=20, length=300, variable= speed, label = "vitesse radiale")
#vitesse.place(x=800,y=160)
def creation():
ngone=typedepoly.get()
coords=[]
global x
x += pi/1000
for loop in range(ngone):
try:
coords.append([cos(x+loop*pi/(ngone/2))*350+400])
coords.append([sin(x+loop*pi/(ngone/2))*350+400])
except:
pass
#print(coords)
canvas.create_polygon(coords)
canvas.update()
canvas.delete("all")
while True:
#vit=vitesse.get()
creation()
root.mainloop()