diff options
| author | Lex Neva <github@lexneva.name> | 2016-11-12 14:05:09 -0500 |
|---|---|---|
| committer | Lex Neva <github@lexneva.name> | 2016-11-12 14:05:09 -0500 |
| commit | 1fedbc11b5cd4801ffd04e2e6b9fb93179de967c (patch) | |
| tree | 4fbbced580f9d11b37d48e56463b715a4abc82ca /PyEmb.py | |
| parent | 055eb63bec189a04a0e42dfa377a4b19b275a870 (diff) | |
clean up PyEmb.Point
Diffstat (limited to 'PyEmb.py')
| -rw-r--r-- | PyEmb.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -34,18 +34,18 @@ class Point: # dot product return self.x * other.x + self.y * other.y elif isinstance(other, (int, float)): - return self.mul(other) + return Point(self.x * other, self.y * other) else: raise ValueError("cannot multiply Point by %s" % type(other)) def __rmul__(self, other): if isinstance(other, (int, float)): - return self.mul(other) + return self.__mul__(other) else: raise ValueError("cannot multiply Point by %s" % type(other)) def __repr__(self): - return "Pt(%s,%s)" % (self.x, self.y) + return "Point(%s,%s)" % (self.x, self.y) def length(self): return math.sqrt(math.pow(self.x, 2.0) + math.pow(self.y, 2.0)) |
