This commit is contained in:
Casper 2018-09-20 15:58:02 +02:00
parent d0f75a4327
commit 1bbb5d9cf3
1 changed files with 5 additions and 4 deletions

View File

@ -59,13 +59,14 @@ def quick_hull(points: Set[Point]):
right = max(points)
hull = {left, right}
points = points - hull
find_hull({p for p in points if not is_left(left, right, p)},
left,
right,
hull)
find_hull({p for p in points if is_left(left, right, p)},
find_hull({p for p in points if not is_left(right, left, p)},
right,
left,
hull)
@ -95,7 +96,7 @@ def find_hull(points: Set[Point], p: Point, q: Point, hull: Set[Point]):
find_hull(s2, farthest, q, hull)
points = {gen_point() for _ in range(10)}
hull = quick_hull(points)
peepees = {gen_point() for _ in range(11)}
hulliees = quick_hull(peepees)
display(points, hull)
display(peepees, hulliees)