mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-09 20:41:10 +00:00
Fixed incorrect maneuver angle calculation from twa in
getManeuverLikelihoodAndTwsTwa
This commit is contained in:
1 parent
c31c079041
commit
01fe50ff04
1 file changed
+4
-2
+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;
|
||||
|
||||
Reference in new issue
Block a user