Parcourir la source

Dateien hochladen nach ''

Hier können Winkel für die Gelenke und Länge der Armabschnitte eingegeben werden, um den Arm in einem Koordinatensystem anzuzeigen.
mkebab il y a 1 an
Parent
commit
3776532260
1 fichiers modifiés avec 28 ajouts et 0 suppressions
  1. 28 0
      main.py

+ 28 - 0
main.py

@@ -0,0 +1,28 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+l = [10, 26, 33, 30]
+alpha = np.array([90, 120, -30, -110]) * (np.pi / 180)
+
+start_x = 0
+start_y = 0
+
+x0 = np.cos(alpha[0]) * l[0]
+y0 = np.sin(alpha[0]) * l[0]
+
+x1 = x0 + np.cos(alpha[1]) * l[1]
+y1 = y0 + np.sin(alpha[1]) * l[1]
+
+x2 = x1 + np.cos(alpha[2]) * l[2]
+y2 = y1 + np.sin(alpha[2]) * l[2]
+
+x3 = x2 + np.cos(alpha[3]) * l[3]
+y3 = y2 + np.sin(alpha[3]) * l[3]
+
+dev_x = [start_x, x0, x1, x2, x3]
+dev_y = [start_y, y0, y1, y2, y3]
+
+plt.plot(dev_x, dev_y, marker='o')
+plt.grid()
+
+plt.show()