Skip to content

Commit

Permalink
ADD apparent wind for WindBarbsOnRoute
Browse files Browse the repository at this point in the history
Change from true wind direction and speed to apparent wind direction
and speed as it is the conditions that we have on the boat...
For example, it helps to see if we can do upwind or not.
  • Loading branch information
theeko74 committed Sep 6, 2018
1 parent 6c16f27 commit 5ce435b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/RouteMapOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,14 +725,13 @@ void RouteMapOverlay::RenderWindBarbsOnRoute(wrDC &dc, PlugIn_ViewPort &vp)
wxPoint p;
GetCanvasPixLL(&nvp, &p, it->lat, it->lon);

double VW = it->VW;
double W = it->W;
// Calculate apparent wind direction
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, VW,
deg2rad(W) + nvp.rotation, it->lat < 0, true
);
g_barbsOnRoute_LineBufferOverlay.pushWindArrowWithBarbs(wind_barb_route_cache, p.x, p.y, apparentWindSpeed, deg2rad(positive_degrees(apparentWindDirection - it->B)) + nvp.rotation, it->lat < 0, true);
}
wind_barb_route_cache.Finalize();

Expand Down

0 comments on commit 5ce435b

Please sign in to comment.