]> git.mxchange.org Git - flightgear.git/commitdiff
Tweak normalisation of route-path segments.
authorJames Turner <zakalawe@mac.com>
Tue, 1 Jan 2013 13:49:12 +0000 (13:49 +0000)
committerJames Turner <zakalawe@mac.com>
Tue, 1 Jan 2013 13:49:12 +0000 (13:49 +0000)
KATL -> KLAX looks correct now. Great-circles that span the 180-meridian are still rendered wrong, but that's a map projection issues, which I will fix in the next few days.

src/Navaids/routePath.cxx

index e17c8c46298adc772147bf0beced939ee77e86c1..afbd628542644387cefbe0fc46ac57a68f2a1bb7 100644 (file)
@@ -147,13 +147,13 @@ void RoutePath::interpolateGreatCircle(const SGGeod& aFrom, const SGGeod& aTo, S
     return;
   }
   
-  lonDelta = SGMiscd::normalizeAngle2(lonDelta);
-
+  lonDelta = SGMiscd::normalizeAngle(lonDelta);    
   int steps = static_cast<int>(fabs(lonDelta) * SG_RADIANS_TO_DEGREES * 2);
   double lonStep = (lonDelta / steps);
   
   double lon = gcFrom.getLongitudeRad() + lonStep;
   for (int s=0; s < (steps - 1); ++s) {
+    lon = SGMiscd::normalizeAngle(lon);
     double lat = latitudeForGCLongitude(gcFrom, gcTo, lon);
     r.push_back(SGGeod::fromGeoc(SGGeoc::fromRadM(lon, lat, SGGeodesy::EQURAD)));
     //SG_LOG(SG_GENERAL, SG_INFO, "lon:" << lon * SG_RADIANS_TO_DEGREES << " gives lat " << lat * SG_RADIANS_TO_DEGREES);