- return coord(self.x-self.x, self.y-self.y)
- def distance(self, other):
+ return coord(self.x-other.x, self.y-other.y)
+ def __mul__(self, other):
+ return coord(self.x*other, self.y*other)
+ def __rmul__(self, other):
+ return coord(self.x*other, self.y*other)
+ def __div__(self, other):
+ return coord(self.x/other, self.y/other)
+ def __rdiv__(self, other):
+ return coord(self.x/other, self.y/other)
+ def snaptogrid(self):
+ return coord(int(round(self.x)), int(round(self.y)))
+ def distance(self, other=None):
+ if not other: other = coord(0, 0)