summaryrefslogtreecommitdiff
path: root/PyEmb.py
diff options
context:
space:
mode:
authorBas Wijnen <wijnen@debian.org>2015-12-15 01:09:25 -0500
committerBas Wijnen <wijnen@debian.org>2015-12-15 01:09:25 -0500
commite7bf0753b5034179bdfc9d97373d9f0acd183775 (patch)
treefed0142e219b4364a86cbfcc5ed6216706b2bb06 /PyEmb.py
parent284e6e4d216453ce7c35041d56465e9f9394f97c (diff)
allow specifying orientation
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)))