mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-18 02:00:58 +00:00
made direction projection null-safe
Change-Id: I0d81e62803ba47d0c4dbe19c1c6a279241a1e8d9
This commit is contained in:
1 parent
85c5866d90
commit
39b5fec647
1 file changed
+1
-1
+1
-1
@@ -4269,7 +4269,7 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
|
||||
|
||||
SpeedWithBearing projectOnto(SpeedWithBearing speed, Bearing projectToBearing) {
|
||||
final SpeedWithBearing result;
|
||||
if (speed.getBearing() != null && projectToBearing != null) {
|
||||
if (speed != null && speed.getBearing() != null && projectToBearing != null) {
|
||||
double cos = Math.cos(speed.getBearing().getRadians() - projectToBearing.getRadians());
|
||||
if (cos < 0) {
|
||||
projectToBearing = projectToBearing.reverse();
|
||||
|
||||
Reference in new issue
Block a user