From e7bf0753b5034179bdfc9d97373d9f0acd183775 Mon Sep 17 00:00:00 2001 From: Bas Wijnen Date: Tue, 15 Dec 2015 01:09:25 -0500 Subject: allow specifying orientation --- PyEmb.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'PyEmb.py') 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))) -- cgit v1.2.3