diff --git a/Vorbereitungen_Fabian/Transformation_Helmert_V3.py b/Vorbereitungen_Fabian/Transformation_Helmert_V3.py index d439169..530bc5d 100644 --- a/Vorbereitungen_Fabian/Transformation_Helmert_V3.py +++ b/Vorbereitungen_Fabian/Transformation_Helmert_V3.py @@ -133,9 +133,9 @@ l = sp.Matrix([P1[0], P1[1], P1[2], P2[0], P2[1], P2[2], P3[0], P3[1], P3[2], P4 while True: if anzahl_iterationen == 0: - zahlen_0 = {dX: Translation[0], dY: Translation[1], dZ: Translation[2], m: m0, q0: q0_wert, q1: q1_wert, - q2: q2_wert, - q3: q3_wert, xp1: p1[0], yp1: p1[1], zp1: p1[2], xp2: p2[0], yp2: p2[1], zp2: p2[2], xp3: p3[0], + zahlen_0 = {dX: float(Translation[0]), dY: float(Translation[1]), dZ: float(Translation[2]), m: float(m0), q0: float(q0_wert), q1: floaT(q1_wert), + q2: float(q2_wert), + q3: float(q3_wert), xp1: p1[0], yp1: p1[1], zp1: p1[2], xp2: p2[0], yp2: p2[1], zp2: p2[2], xp3: p3[0], yp3: p3[1], zp3: p3[2], xp4: p4[0], yp4: p4[1], zp4: p4[2], xp5: p5[0], yp5: p5[1], zp5: p5[2]} x0 = sp.Matrix([zahlen_0[dX], zahlen_0[dY], zahlen_0[dZ], zahlen_0[m], zahlen_0[q0], zahlen_0[q1], zahlen_0[q2], zahlen_0[q3]]) R_matrix_0 = sp.Matrix([[1 - 2 * (q2_wert ** 2 + q3_wert ** 2), 2 * (q1_wert * q2_wert - q0_wert * q3_wert), @@ -166,12 +166,10 @@ while True: print(dx.evalf(n=3)) else: - print("Im else-Block") zahlen_i = {dX: float(x[0]), dY: float(x[1]), dZ: float(x[2]), m: float(x[3]), q0: float(x[4]), q1: float(x[5]), q2: float(x[6]), q3: float(x[7]), xp1: p1[0], yp1: p1[1], zp1: p1[2], xp2: p2[0], yp2: p2[1], zp2: p2[2], xp3: p3[0], yp3: p3[1], zp3: p3[2], xp4: p4[0], yp4: p4[1], zp4: p4[2], xp5: p5[0], yp5: p5[1], zp5: p5[2]} - print("zahlen_i") R_matrix_i = sp.Matrix([[1 - 2 * (zahlen_i[q2] ** 2 + zahlen_i[q3] ** 2), 2 * (zahlen_i[q1] * zahlen_i[q2] - zahlen_i[q0] * zahlen_i[q3]), 2 * (zahlen_i[q0] * zahlen_i[q2] + zahlen_i[q1] * zahlen_i[q3])], [2 * (zahlen_i[q1] * zahlen_i[q2] + zahlen_i[q0] * zahlen_i[q3]), 1 - 2 * (zahlen_i[q1] ** 2 + zahlen_i[q3] ** 2), @@ -247,7 +245,14 @@ liste_l_berechnet_i = [sp.Matrix([zahlen_i[dX], zahlen_i[dY], zahlen_i[dZ]]) + z l_berechnet_i = sp.Matrix.vstack(*liste_l_berechnet_i) print("") print("l_berechnet_final:") + +liste_punkte_zielsystem = [P1, P2, P3, P4, P5] for v in l_berechnet_i: print(f"{float(v):.3f}") +print("Streckendifferenzen:") +streckendifferenzen = [P - L].norm() for P, L in zip(liste_punkte_zielsystem, l_berechnet_i) +print([roundfloat(s.evalf()) for s in strecken]) + + #ToDo: Abweichungen in Printausgabe ausgeben! \ No newline at end of file