Clean distance

This commit is contained in:
2024-06-11 02:26:18 +02:00
parent 0070fc531d
commit 5ea926c9f8
2 changed files with 8 additions and 1 deletions

View File

@@ -15,3 +15,6 @@ class Point3D:
def __repr__(self):
return f"Point2D(x: {self.x}, y: {self.y}, z: {self.z})"
def distance(self, point: Type[Point3D]):
return sqrt((point.x - self.x) ** 2 + (point.y - self.y) ** 2 + (point.z - self.z) ** 2)