-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunctions.py
38 lines (30 loc) · 1.03 KB
/
Functions.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
from Queue import Queue
from Circle import Circle
import math as mt
import time
def createQueue(amount):
queue = Queue()
#Ele pega a referencia, então toda a minha fila iria ser um objeto só, caso eu
#mudasse em um mudava em todos
#aux = Circle()
for i in range(0, amount):
name = input("digite o nome ")
queue.enqueue(Circle(name))
return queue
def newPos(angle, position, lenght, height):
coord_x = (200 * mt.cos(mt.radians(angle)) + (lenght / 2) )
coord_y = (200 * mt.sin(mt.radians(angle)) + (height/ 2) )
return (coord_x, coord_y)
def setPos(queue, angle, position, lenght, height, angulo_soma):
aux = queue.getFirstNode()
for i in range(0, queue.getSize()):
value = newPos(angle, position, lenght, height)
aux.value.setPos(value[0], value[1])
aux = aux.next
angle += angulo_soma
def initialTime():
return time.time()
def getTime(initialtime):
return (time.time() - initialtime)
def delay(valueToDelay):
time.sleep(valueToDelay)