Calculation of upwind downwind leg given a boat, wind and next mark now works. created GeometryUtils class

Can accurately calculate if a boat is going upwind or downward using a line function for the wind vector from the gate and the boat position from the gate.

Requires knowledge of the next mark which requires the boat to have passed a mark. This could be fixed by extracting the leg number from the race status packet and mapping these to gates in an initalisation step

tags: #story[956]
This commit is contained in:
William Muir
2017-05-24 14:57:22 +12:00
parent 89464e033e
commit 1cac7cc189
7 changed files with 200 additions and 30 deletions
@@ -435,7 +435,7 @@ public class CanvasController {
return findScaledXY (unscaled.getLatitude(), unscaled.getLongitude());
}
private Point2D findScaledXY (double unscaledLat, double unscaledLon) {
public Point2D findScaledXY (double unscaledLat, double unscaledLon) {
double distanceFromReference;
double angleFromReference;
int xAxisLocation = (int) referencePointX;
@@ -468,4 +468,8 @@ public class CanvasController {
List<BoatGroup> getBoatGroups() {
return boatGroups;
}
List<MarkGroup> getMarkGroups() {
return markGroups;
}
}