Ejemplo n.º 1
0
def contains_point() -> None:
    polygon = Polygon(points[0: len(points) - 1])
    polygon.draw(canvas)
    if polygon.does_contain(points[-1]):
        messagebox.showinfo("Result", "Point is INSIDE polygon")
    else:
        messagebox.showinfo("Result", "Point is OUTSIDE polygon")
Ejemplo n.º 2
0
def is_convex() -> None:
    polygon = Polygon(points)
    polygon.draw(canvas)
    if polygon.is_convex():
        messagebox.showinfo("Result", "Polygon IS convex")
    else:
        messagebox.showinfo("Result", "Polygon IS NOT convex")
Ejemplo n.º 3
0
def make_convex_hull() -> None:
    polygon = Polygon(points)
    polygon.make_convex_hull()
    polygon.draw(canvas)
Ejemplo n.º 4
0
def make_simple_polygon() -> None:
    polygon = Polygon(points)
    polygon.make_simple()
    polygon.draw(canvas)