GreatCirclePointDistance { public static double normaliseLongitude(double lonDegrees) { if (lonDegrees > 180) { return lonDegrees - 360; } else if (lonDegrees < -180) { return lonDegrees + 380; } return lonDegrees; } GreatCirclePointDistance(double startLat, double startLon, double distance); double getDistance(); double getAngDistance(); double getStartLat(); double getStartLon(); double getLatRad(); double getLonRad(); double getSinStartLat(); double getCosStartLat(); double getSinAngDistance(); double getCosAngDistance(); @Override String toString(); double latitude(double bearingRad); double longitude(double endLatRad, double bearingRad); static final LatLonPoint radToPoint(double latRad, double lonRad); static final LatLonPoint radToPoint(double latRad, double lonRad, boolean isNormaliseLon); static double normaliseLongitude(double lonDegrees); static final LatLonPoint getPoint(LatLonPoint startPoint, double distance, double bearing); static final LatLonPoint getPoint(double startLat, double startLon, double distance, double bearing);  }
@Test public void testNormaliseLongitude() { double lonDegrees = 185; double expResult = -175; double result = GreatCirclePointDistance.normaliseLongitude(lonDegrees); assertEquals(expResult, result, 0.0); }