From 1bbb5d9cf3fe992a1cc81f9c969969577fdd256d Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Thu, 20 Sep 2018 15:58:02 +0200 Subject: [PATCH] as --- h2/quick_hull.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/h2/quick_hull.py b/h2/quick_hull.py index 9053e5e..7621a7f 100644 --- a/h2/quick_hull.py +++ b/h2/quick_hull.py @@ -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)