From 57553b3ccef5b876eca5486262e4a0a399eb5514 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Wed, 9 Aug 2023 15:14:49 +0200 Subject: [PATCH] fix cast error --- lib/Route/route.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Route/route.cpp b/lib/Route/route.cpp index 07c03a4..5f5b395 100644 --- a/lib/Route/route.cpp +++ b/lib/Route/route.cpp @@ -74,7 +74,7 @@ int16_t Point::courseTo(const Coordinates& point) const { double phi = log( tan(end.lat * ROUTE_DEGREE_TO_RADIANT / 2 + ROUTE_PI / 4) / tan(begin.lat * ROUTE_DEGREE_TO_RADIANT / 2 + ROUTE_PI / 4) ); double lon = (begin.lon * ROUTE_DEGREE_TO_RADIANT - end.lon * ROUTE_DEGREE_TO_RADIANT); - int16_t res = (int16_t) atan2(lon, phi) / ROUTE_DEGREE_TO_RADIANT; + int16_t res = static_cast(atan2(lon, phi) / ROUTE_DEGREE_TO_RADIANT) * -1; // if (res < 0) // res += 360;