Skip to content

Commit

Permalink
FIX apparent wind angle for WindBarbsOnRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
theeko74 committed Sep 6, 2018
1 parent f8c3122 commit d20dc09
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/RouteMapOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,14 @@ void RouteMapOverlay::RenderWindBarbsOnRoute(wrDC &dc, PlugIn_ViewPort &vp)
GetCanvasPixLL(&nvp, &p, it->lat, it->lon);

// Calculate apparent wind direction
float apparentWindSpeed = Polar::VelocityApparentWind(it->VB, it->W, it->VW);
float apparentWindDirection = Polar::DirectionApparentWind(apparentWindSpeed, it->VB, it->W, it->VW);
float windDirection = heading_resolve(it->B - it->W);
float apparentWindSpeed = Polar::VelocityApparentWind(it->VB, windDirection, it->VW);
float apparentWindDirection = Polar::DirectionApparentWind(apparentWindSpeed, it->VB, windDirection, it->VW);

// Draw barbs
g_barbsOnRoute_LineBufferOverlay.pushWindArrowWithBarbs(
wind_barb_route_cache, p.x, p.y, apparentWindSpeed,
deg2rad(apparentWindDirection) + nvp.rotation, it->lat < 0, true
deg2rad(positive_degrees(apparentWindDirection - it->B)) + nvp.rotation, it->lat < 0, true
);
}
wind_barb_route_cache.Finalize();
Expand Down

0 comments on commit d20dc09

Please sign in to comment.