-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolygons.py
More file actions
43 lines (33 loc) · 1 KB
/
polygons.py
File metadata and controls
43 lines (33 loc) · 1 KB
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
import os, time, math, random
from interfaceapi import *
tela = Tela(211, 114)
star = Star(tela.center(), 25)
star = RegularPolygon(tela.center(), 5, 25, -math.pi/10, 2)
circle = Circunference(tela.center(), 26)
pentagon = RegularPolygon(tela.center(), 5, 35)
hexagon = RegularPolygon(tela.center(), 6, 50, math.pi)
u_pentagon = RegularPolygon(tela.center(), 5, 43, 1*math.pi/5)
scene = [
RegularPolygon(tela.center(), 3, 100),
RegularPolygon(tela.center(), 3, 100, math.pi),
star,
circle,
hexagon,
pentagon,
u_pentagon,
Circunference(tela.center(), 50),
Circunference(tela.center(), 43)
]
while True:
tela.clear()
tela.drawBorder()
scene[0].rotate(-math.pi/320)
scene[1].rotate(-math.pi/320)
star.rotate(-math.pi/80)
pentagon.rotate(math.pi/80)
u_pentagon.rotate(math.pi/80)
for object in scene:
tela.drawObject(object)
os.system('clear')
print(tela.toString())
time.sleep(0.1)