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 5, 2018
1 parent 6c16f27 commit f8c3122
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/RouteMapOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,13 +725,14 @@ 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 apparentWindSpeed = Polar::VelocityApparentWind(it->VB, it->W, it->VW);
float apparentWindDirection = Polar::DirectionApparentWind(apparentWindSpeed, it->VB, it->W, 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
wind_barb_route_cache, p.x, p.y, apparentWindSpeed,
deg2rad(apparentWindDirection) + nvp.rotation, it->lat < 0, true
);
}
wind_barb_route_cache.Finalize();
Expand Down

0 comments on commit f8c3122

Please sign in to comment.