From 3e745059a26664604af1c201f9c3797590e257d9 Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Thu, 5 Jun 2025 15:59:14 +0200 Subject: [PATCH] feat!: update angle to steps conversion factors --- maths.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maths.cpp b/maths.cpp index 23ad236..571e6a3 100644 --- a/maths.cpp +++ b/maths.cpp @@ -6,11 +6,11 @@ double radToDeg(double rad) { return rad * 180.0 / M_PI; } void angleToStep(long &stepX, long &stepY, double angleX, double angleY) { // TODO remove magic numbers - double stepRatioX = M_PI / ((51.2 / 15.0) * (100.0 * 64.0)); - double stepRatioY = M_PI / ((48.0 / 15.0) * (100.0 * 64.0)); + double stepRatioX = 6000 / M_PI; + double stepRatioY = 6500 / M_PI; - stepX = angleX / stepRatioX; - stepY = angleY / stepRatioY; + stepX = angleX * stepRatioX; + stepY = angleY * stepRatioY; } void cartesianToPolar(long &stepX, long &stepY, double zeroX, double zeroY,