from Polygon import Polygon import matplotlib.pyplot as plt fig = plt.figure(figsize=(6,6),dpi=100) axes = fig.add_axes([0.1,0.1,0.8,.8]) axes.set_title("Lines example") axes.set_xlim([0,15]) axes.set_ylim([0,15]) verices = [(5,5), (10,8), (12, 5), (10, 2)] poly = Polygon (verices, 'b') print(poly) height = poly.get_height('B', 'A', 'D') height.draw() height = poly.get_height('D', 'A', 'B') height.draw() height = poly.get_height('D', 'B', 'C') height.draw() print('Perimeter', poly.perimeter()) print('Area: ', poly.area()) print('simple polygon: ',poly.is_simple()) poly.draw(axes) plt.show()