Commit d541b1f4 authored by Taddeus Kroes's avatar Taddeus Kroes

Corrected faulty import of PI.

parent a495e74e
#!/usr/bin/env python #!/usr/bin/env python
from events import TapEvent, FlickEvent, RotateEvent, PinchEvent, PanEvent from events import TapEvent, FlickEvent, RotateEvent, PinchEvent, PanEvent
import time import time
from math import atan2, PI from math import atan2, pi
from threading import Thread from threading import Thread
from OSC import OSCServer from OSC import OSCServer
...@@ -137,11 +137,11 @@ class MultiTouchListener(object): ...@@ -137,11 +137,11 @@ class MultiTouchListener(object):
p.set_angle(atan2(p.y - cy, p.x - cx)) p.set_angle(atan2(p.y - cy, p.x - cx))
da = p.angle_diff() da = p.angle_diff()
# Assert that angle is in [-PI, PI] # Assert that angle is in [-pi, pi]
if da > PI: if da > pi:
da -= 2 * PI da -= 2 * pi
elif da < PI: elif da < pi:
da += 2 * PI da += 2 * pi
rotation += da rotation += da
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment