... | @@ -121,9 +121,9 @@ point3 = (1, 7) |
... | @@ -121,9 +121,9 @@ point3 = (1, 7) |
|
|
|
|
|
points = [point1, point2, point3]
|
|
points = [point1, point2, point3]
|
|
|
|
|
|
shortest_distance = min((sqrt(point.x ** 2 + point.y ** 2)) for point in points)
|
|
shortest_distance = min((sqrt(point[0] ** 2 + point[1] ** 2)) for point in points)
|
|
largest_distance = max((sqrt(point.x ** 2 + point.y ** 2)) for point in points)
|
|
largest_distance = max((sqrt(point[0] ** 2 + point[1] ** 2)) for point in points)
|
|
average_distance = sum((sqrt(point.x ** 2 + point.y ** 2)) for point in points) / len(points)
|
|
average_distance = sum((sqrt(point[0] ** 2 + point[1] ** 2)) for point in points) / len(points)
|
|
```
|
|
```
|
|
|
|
|
|
Of course... we should clean it up...
|
|
Of course... we should clean it up...
|
... | @@ -131,7 +131,7 @@ Of course... we should clean it up... |
... | @@ -131,7 +131,7 @@ Of course... we should clean it up... |
|
```python
|
|
```python
|
|
points = [(0, 5), (8, 3), (1, 7)]
|
|
points = [(0, 5), (8, 3), (1, 7)]
|
|
|
|
|
|
distances = [sqrt(point.x ** 2 + point.y ** 2) for point in points]
|
|
distances = [sqrt(point[0] ** 2 + point[1] ** 2) for point in points]
|
|
|
|
|
|
shortest_distance = min(distances)
|
|
shortest_distance = min(distances)
|
|
largest_distance = max(distances)
|
|
largest_distance = max(distances)
|
... | | ... | |