Fixed boat heading calculation method to get a correct direction

#story[480] #pair[hyi25, ptg19]
This commit is contained in:
Haoming Yin
2017-03-27 14:29:03 +13:00
parent bbe7cbee8f
commit cf6bbdd1f1
+5 -2
View File
@@ -113,7 +113,8 @@ public class Event {
} }
/** /**
* @return the boats heading * Calculates current boat heading direction.
* @return the boats heading as degree. vertical upward is 0 degree, and degree goes up clockwise.
*/ */
public double getBoatHeading() { public double getBoatHeading() {
if (mark2 == null){ if (mark2 == null){
@@ -132,7 +133,9 @@ public class Event {
} }
// Convert back to degrees, and flip 180 degrees // Convert back to degrees, and flip 180 degrees
return (Math.toDegrees(headingRadians) + 180) % 360; // return ((headingRadians) * 180) / Math.PI;
return (Math.toDegrees(headingRadians) + 90) % 360;
} }
public Mark getThisMark() { public Mark getThisMark() {