Fixed heading calculation to be N=0,W=90,S=180,E=270

This commit is contained in:
Obique PSWG
2019-09-27 07:46:30 -04:00
parent e34be46179
commit 22a8a6b7dc

View File

@@ -146,7 +146,7 @@ public class Location implements Encodable, Persistable, MongoPersistable {
}
public double getHeadingTo(Location target) {
return (Math.toDegrees(Math.atan2(target.getX()-getX(), target.getZ()-getZ())) + 360) % 360;
return ((360 - Math.toDegrees(Math.atan2(target.getX()-getX(), target.getZ()-getZ())) + 360) % 360);
}
public double getHeadingTo(Point3D target) {