Done and fix

This commit is contained in:
Casper 2018-09-20 16:59:42 +02:00
parent 8da0712c72
commit 782fefdb06
1 changed files with 6 additions and 7 deletions

View File

@ -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)