Find index of leftmost point (and bottom-most in case of tie).
(points: list[Point])
| 70 | |
| 71 | |
| 72 | def _find_leftmost_point(points: list[Point]) -> int: |
| 73 | """Find index of leftmost point (and bottom-most in case of tie).""" |
| 74 | left_idx = 0 |
| 75 | for i in range(1, len(points)): |
| 76 | if points[i].x < points[left_idx].x or ( |
| 77 | points[i].x == points[left_idx].x and points[i].y < points[left_idx].y |
| 78 | ): |
| 79 | left_idx = i |
| 80 | return left_idx |
| 81 | |
| 82 | |
| 83 | def _find_next_hull_point(points: list[Point], current_idx: int) -> int: |