From 782fefdb06e341720b10e75cc260d31c3e3dfe98 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Thu, 20 Sep 2018 16:59:42 +0200 Subject: [PATCH] Done and fix --- h2/quick_hull.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/h2/quick_hull.py b/h2/quick_hull.py index b9d3709..bd5f346 100644 --- a/h2/quick_hull.py +++ b/h2/quick_hull.py @@ -1,11 +1,10 @@ import random from collections import namedtuple +from enum import Enum, auto +from math import sqrt from typing import Set import matplotlib.pyplot as plt -from enum import Enum, auto -from math import atan2, degrees, tau, pi, acos, sqrt - Point = namedtuple('Point', 'x y') @@ -23,7 +22,7 @@ def display(points, hull): h_x = [point.x for point in hull] h_y = [point.y for point in hull] - plt.plot(h_x, h_y, 'ro-') + plt.plot(h_x, h_y, 'ro') plt.scatter(x, y) plt.show() @@ -90,7 +89,7 @@ def find_hull(points: Set[Point], p: Point, q: Point, hull: Set[Point]): hull) -peepees = {gen_point() for _ in range(30)} -hulliees = quick_hull(peepees) +points = {gen_point() for _ in range(30)} +hull = quick_hull(points) -display(peepees, hulliees) +display(points, hull)