diff options
| author | Bas Wijnen <wijnen@debian.org> | 2015-12-15 01:09:25 -0500 |
|---|---|---|
| committer | Bas Wijnen <wijnen@debian.org> | 2015-12-15 01:09:25 -0500 |
| commit | e7bf0753b5034179bdfc9d97373d9f0acd183775 (patch) | |
| tree | fed0142e219b4364a86cbfcc5ed6216706b2bb06 /PyEmb.py | |
| parent | 284e6e4d216453ce7c35041d56465e9f9394f97c (diff) | |
allow specifying orientation
Diffstat (limited to 'PyEmb.py')
| -rw-r--r-- | PyEmb.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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))) |
