EGM2008 offset lookup for negative longitudes was wrong.

This commit is contained in:
Dennis Guse
2022-08-02 07:32:27 +02:00
parent 2b530a1c53
commit 7009ede095
2 changed files with 29 additions and 4 deletions
@@ -65,7 +65,7 @@ public class EGM2008Utils {
if (location.getLongitude() >= 0) {
longitude = location.getLongitude();
} else {
longitude = 180 + Math.abs(location.getLongitude());
longitude = 360 + location.getLongitude();
}
int longitudeIndex = (int) (longitude * RESOLUTION_IN_MINUTES);
@@ -172,5 +172,13 @@ public class EGM2008Utils {
public int hashCode() {
return Objects.hash(latitudeIndex, longitudeIndex);
}
@Override
public String toString() {
return "Indices{" +
"latitudeIndex=" + latitudeIndex +
", longitudeIndex=" + longitudeIndex +
'}';
}
}
}