Mock.Polars:

Fixed a bug where calculateVMG was placing velocity into the VMG object, instead of speed.
Maybe fixed a bug when a bearingLowerBound which is greater than bearingUpperBound is provided.
Added another test case.

Mock.Constants:
Added knots to millimeters per second conversion factor.

Mock.Boat:
Added calculateDIstanceToNextMarker function, which returns the distance, in nautical miles, to the next mark.

Mock.Race:
Added wind direction as a race property.
Added wind speed as a race property.
The race status messages sent by Race now use Race's wind speed and direction.

#story[873]
This commit is contained in:
fjc40
2017-05-14 22:34:05 +12:00
parent 7f37dbbcb5
commit f4d5df9df2
6 changed files with 71 additions and 8 deletions
@@ -89,6 +89,25 @@ public class PolarsTest {
//assertEquals(calcVMGAngle3, vmgAngle3, angleEpsilon);
//assertEquals(calcVMGSpeed3, vmgSpeed3, speedEpsilon);
//Test 4.
//This test has a wind speed of 0.
double windAngle4 = 5;
double destAngle4 = 100;
double windSpeed4 = 0;//knots
double vmgAngle4 = 88;
double vmgSpeed4 = 12;
VMG calcVMG4 = polars.calculateVMG(windAngle4, windSpeed4, destAngle4, 0, 360);
double calcVMGAngle4 = calcVMG4.getBearing();
double calcVMGSpeed4 = calcVMG4.getSpeed();
System.out.println("VMG speed = " + calcVMGSpeed4 + " , VMG angle = " + calcVMGAngle4);//TEMP DEBUG REMOVE
//assertEquals(calcVMGAngle4, vmgAngle4, angleEpsilon);
//assertEquals(calcVMGSpeed4, vmgSpeed4, speedEpsilon);
}
}