diff --git a/tools/coordinate.py b/tools/coordinate.py index a27d7bb..0871fe4 100644 --- a/tools/coordinate.py +++ b/tools/coordinate.py @@ -176,6 +176,21 @@ class Coordinate: else: return self.__class__(self.x - other.x, self.y - other.y, self.z - other.z) + def __mul__(self, other: int) -> Coordinate: + if self.z is None: + return self.__class__(self.x * other, self.y * other) + else: + return self.__class__(self.x * other, self.y * other, self.z * other) + + def __floordiv__(self, other) -> Coordinate: + if self.z is None: + return self.__class__(self.x // other, self.y // other) + else: + return self.__class__(self.x // other, self.y // other, self.z // other) + + def __truediv__(self, other): + return self // other + def __eq__(self, other): if not isinstance(other, Coordinate): return False