as
This commit is contained in:
parent
d0f75a4327
commit
1bbb5d9cf3
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user