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,