diff --git a/maths.cpp b/maths.cpp index 2aaff10..6214c64 100644 --- a/maths.cpp +++ b/maths.cpp @@ -5,8 +5,8 @@ double degToRad(double deg) { return deg * M_PI / 180.0; } double radToDeg(double rad) { return rad * 180.0 / M_PI; } -void angleToStep(Turret::StepRatio stepRatio, vec2 angle, - vec2 &step) { +void radToStep(Turret::StepRatio stepRatio, vec2 angle, + vec2 &step) { step.x = angle.x * stepRatio.x; step.y = angle.y * stepRatio.y; } @@ -22,5 +22,5 @@ void cartesianToPolar(Turret::StepRatio stepRatio, Turret::Offset offset, vec2 angle(atan2(dZ, dY) - M_PI / 2, atan2(dZ, dX) - M_PI / 2); - angleToStep(stepRatio, angle, step); + radToStep(stepRatio, angle, step); } diff --git a/maths.h b/maths.h index 01d98da..4724c71 100644 --- a/maths.h +++ b/maths.h @@ -5,8 +5,8 @@ double degToRad(double deg); double radToDeg(double rad); -void angleToStep(Turret::StepRatio stepRatio, vec2 angle, - vec2 &step); +void radToStep(Turret::StepRatio stepRatio, vec2 angle, + vec2 &step); void cartesianToPolar(Turret::StepRatio stepRatio, Turret::Offset offset, vec2 zero, vec3 position, vec2 &step); diff --git a/turret.cpp b/turret.cpp index 665833d..6c71b01 100644 --- a/turret.cpp +++ b/turret.cpp @@ -132,11 +132,11 @@ Turret &Turret::moveTo(double x, double y, double z, Unit unit) { } if (unit == Unit::RAD) { - angleToStep(_step_ratio, vec2(x, y), step); + radToStep(_step_ratio, vec2(x, y), step); } if (unit == Unit::DEG) { - angleToStep(_step_ratio, vec2(degToRad(x), degToRad(y)), step); + radToStep(_step_ratio, vec2(degToRad(x), degToRad(y)), step); } long maxDeltaStepX = _step_ratio.x * M_PI_2;