GreatCirclePointDistance { public static final LatLonPoint getPoint(LatLonPoint startPoint, double distance, double bearing) { double startLat = startPoint.getLat(); double startLon = startPoint.getLon(); return GreatCirclePointDistance.getPoint(startLat, startLon, distance, bearing); } 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 testGetPoint_3args_North() { double startLat = 48.85341; double startLon = -2.3488; double distance = 100000.0; LatLonPoint startPoint = new LatLonPoint(startLat, startLon); double bearing = 0.0; LatLonPoint expResult = new LatLonPoint(49.752730, -2.3488); LatLonPoint result = GreatCirclePointDistance.getPoint(startPoint, distance, bearing); assertEquals(expResult, result); }
@Test public void testGetPoint_4args_North() { double startLat = 48.85341; double startLon = -2.3488; double distance = 100000.0; double bearing = 0.0; LatLonPoint expResult = new LatLonPoint(49.752730, -2.3488); LatLonPoint result = GreatCirclePointDistance.getPoint(startLat, startLon, distance, bearing); assertEquals(expResult, result); }
@Test public void testGetPoint_3args_East() { double startLat = 48.85341; double startLon = -2.3488; double distance = 100000.0; LatLonPoint startPoint = new LatLonPoint(startLat, startLon); double bearing = 90.0; LatLonPoint expResult = new LatLonPoint(48.845333, -0.982173); LatLonPoint result = GreatCirclePointDistance.getPoint(startPoint, distance, bearing); assertEquals(expResult, result); }
@Test public void testGetPoint_4args_East() { double startLat = 48.85341; double startLon = -2.3488; double distance = 100000.0; double bearing = 90.0; LatLonPoint expResult = new LatLonPoint(48.845333, -0.982173); LatLonPoint result = GreatCirclePointDistance.getPoint(startLat, startLon, distance, bearing); assertEquals(expResult, result); }