From f75ecf111237bc3b22ee8d5c270c3b8f483595c0 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 31 Mar 2023 11:49:56 +0200 Subject: [PATCH] Normalize polar angle at creation --- src/Polar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Polar.cpp b/src/Polar.cpp index 5d42990..c1f36f0 100644 --- a/src/Polar.cpp +++ b/src/Polar.cpp @@ -11,10 +11,10 @@ Polar::Polar() { Polar::Polar(float newAngle, float newDistance) { // distance should always be 0 or greater if (newDistance < 0) { - angle = newAngle - 180; + angle = Angle::Normalize(newAngle - 180); distance = -newDistance; } else { - angle = newAngle; + angle = Angle::Normalize(newAngle); distance = newDistance; } }