mirror of
https://bitbucket.org/projectswg/pswgcommon.git
synced 2026-01-16 23:04:32 -05:00
Fixed heading calculation to be N=0,W=90,S=180,E=270
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user