From 3b258108a02edae6644404ea16d10f27153e533e Mon Sep 17 00:00:00 2001 From: Pavel Date: Sat, 16 Oct 2021 12:41:52 +0200 Subject: [PATCH] add corrections to coordinates in test.py --- alrys/test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alrys/test.py b/alrys/test.py index 41f8c68..fd73c69 100644 --- a/alrys/test.py +++ b/alrys/test.py @@ -28,7 +28,9 @@ index = 2 def mon_itineraire(): global steps, position, index - x, y = steps[index * 2:(index + 1) * 2] + x, a, y, b = steps[(index - 1) * 4:index * 4] + x += a * 1e-14 + y += b * 1e-14 a = atan2(y - position[1], x - position[0]) * 180.0 / pi - position[2] l = hypot(x - position[0], y - position[1]) a_droite(a) @@ -37,6 +39,6 @@ def mon_itineraire(): position[0] += l * cos(position[2] * pi / 180.0) position[1] += l * sin(position[2] * pi / 180.0) index += 1 - return len(steps) >= (index + 1) * 2 + return len(steps) >= index * 4 print(aller_selon(mon_itineraire))