GreatCirclePointDistance { public double longitude(double endLatRad, double bearingRad) { return lonRad + Math.atan2(Math.sin(bearingRad) * sinAngDistance * cosStartLat, cosAngDistance - sinStartLat * Math.sin(endLatRad)); } 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 testLongitude() { double endLatRad = 0.86833; double startLat = 48.85341; double startLon = -2.3488; double distance = 100000.0; double bearingRad = 0.0; GreatCirclePointDistance instance = new GreatCirclePointDistance(startLat, startLon, distance); double expResult = -0.040994; double result = instance.longitude(endLatRad, bearingRad); assertEquals(expResult, result, 0.00001); }