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)