Fixed incorrect maneuver angle calculation from twa in

getManeuverLikelihoodAndTwsTwa
This commit is contained in:
Vladislav Chumak committed 2018-07-25 12:23:11 +02:00
1 parent c31c079041
commit 01fe50ff04
1 file changed
+4 -2
@@ -170,8 +170,10 @@ public class PolarDataServiceImpl implements ReplicablePolarService, ClearStateT
if (closestTwsTwa == null) {
result = new Pair<>(0.0, null);
} else {
double minDiffDeg = Math.abs(Math.abs(Math.abs(closestTwsTwa.getObject().getBearing().getDegrees() * 2)
- Math.abs(courseChangeDeg)));
double targetManeuverAngle = getManeuverAngleInDegreesFromTwa(
closestTwsTwa.getObject().getBearing().getDegrees(), maneuverType);
double minDiffDeg = Math.abs(Math.abs(targetManeuverAngle)
- Math.abs(courseChangeDeg));
result = new Pair<>(1. / (1. + (minDiffDeg / 10.) * (minDiffDeg / 10.)), closestTwsTwa);
}
return result;