From a6bea3e625aaccc7326d7b2d8c35d3e527b4bedf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 18 Jun 2017 18:29:02 +0200 Subject: logic/tracker: wraparound degrees over 360 --- logic/tracker.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'logic') diff --git a/logic/tracker.cpp b/logic/tracker.cpp index 533a6f54..57995d37 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -147,6 +147,8 @@ void Tracker::logic() using std::copysign; using std::fabs; + value(i) = std::fmod(value(i), 360); + const double x = value(i); if (fabs(x) - 1e-2 > 180) value(i) = fmod(x + copysign(180, x), 360) - copysign(180, x); -- cgit v1.2.3