From 1707751bf3a944ead7cdcfefade47d1f180835e7 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Wed, 25 Jan 2023 14:42:13 +0000 Subject: [PATCH] Fix angle when newDistance < 0 --- src/Polar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Polar.cpp b/src/Polar.cpp index 189891a..9334733 100644 --- a/src/Polar.cpp +++ b/src/Polar.cpp @@ -11,7 +11,7 @@ Polar::Polar() { Polar::Polar(float newAngle, float newDistance) { // distance should always be 0 or greater if (newDistance < 0) { - angle = angle - 180; + angle = newAngle - 180; distance = -newDistance; } else { angle = newAngle;