diff --git a/basictypes.py b/basictypes.py index 1586e03..beea2e2 100644 --- a/basictypes.py +++ b/basictypes.py @@ -35,6 +35,11 @@ class Point: def apply_cartesian_shift(self, x, y) -> None: pass + def distance_from_point(self, point) -> float: + # Euclidian distance + distance = math.sqrt((self.get_x() - point.get_x())**2 + (self.get_y() - point.get_y())**2) + return distance + class PointWithID(Point):