MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / _find_leftmost_point

Function _find_leftmost_point

geometry/jarvis_march.py:72–80  ·  view source on GitHub ↗

Find index of leftmost point (and bottom-most in case of tie).

(points: list[Point])

Source from the content-addressed store, hash-verified

70
71
72def _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
83def _find_next_hull_point(points: list[Point], current_idx: int) -> int:

Callers 1

jarvis_marchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected