commit 5bc7be827687d039612d8d0fc287b47991e1e9c6 (tree)
parent 437de18474732eb2e0f1d1410f1e7fca13736948
Author: Motiejus Jakštys <desired.mta@gmail.com>
Date: Thu, 28 Nov 2019 18:54:24 +0200
humble drawing
Diffstat:
1 file changed, 25 insertions(+), 0 deletions(-)
diff --git a/Karto/assignment4/draw.py b/Karto/assignment4/draw.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+import matplotlib.pyplot as plt
+from shapely.geometry import LineString
+from math import sqrt
+
+def heptagon(linelen, slant):
+ inner_angle = 180*5/7
+ pts = [(0, 0)]
+ dx = linelen * sin(
+ for _ in range(7):
+
+def plot_line(ax, ob):
+ x, y = ob.xy
+ ax.plot(x, y, color='#6699cc', alpha=0.7, linewidth=3, solid_capstyle='round', zorder=2)
+
+fig, ax = plt.subplots()
+line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
+
+#plot_coords(ax, line)
+#plot_bounds(ax, line)
+plot_line(ax, line)
+
+ax.set_title('Užliejamų plotų brėžinys')
+
+plt.show()