summaryrefslogtreecommitdiff
path: root/PyEmb.py
diff options
context:
space:
mode:
Diffstat (limited to 'PyEmb.py')
-rw-r--r--PyEmb.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/PyEmb.py b/PyEmb.py
index 46d7bf77..0423b583 100644
--- a/PyEmb.py
+++ b/PyEmb.py
@@ -31,6 +31,9 @@ class Point:
def rotate_left(self):
return Point(-self.y, self.x)
+ def rotate(self, angle):
+ return Point(self.x * math.cos(angle) - self.y * math.sin(angle), self.y * math.cos(angle) + self.x * math.sin(angle))
+
def as_int(self):
return Point(int(round(self.x)), int(round(self.y)))