@Test public void testKnownDistanceD() { LatLon begin = LatLon.fromDegrees(51.4898, 0.0539); LatLon end = LatLon.fromDegrees(42.3232, -71.0974); double distance = LatLon.ellipsoidalDistance( begin, end, globe.getEquatorialRadius(), globe.getPolarRadius()); assertEquals("Known ellipsoidal distance D", 5296396.967, distance, TOLERANCE); }
@Test public void testKnownDistanceB() { LatLon begin = LatLon.fromDegrees(9.2118, -79.5180); LatLon end = LatLon.fromDegrees(48.4216, -122.3352); double distance = LatLon.ellipsoidalDistance( begin, end, globe.getEquatorialRadius(), globe.getPolarRadius()); assertEquals("Known ellipsoidal distance B", 5900926.896, distance, TOLERANCE); }
@Test public void testKnownDistanceC() { LatLon begin = LatLon.fromDegrees(-31.9236, 116.1231); LatLon end = LatLon.fromDegrees(23.6937, 121.9831); double distance = LatLon.ellipsoidalDistance( begin, end, globe.getEquatorialRadius(), globe.getPolarRadius()); assertEquals("Known ellipsoidal distance C", 6186281.864, distance, TOLERANCE); }
@Test public void testKnownDistanceA() { LatLon begin = LatLon.fromDegrees(30.608879, -102.118357); LatLon end = LatLon.fromDegrees(34.413929, -97.022765); double distance = LatLon.ellipsoidalDistance( begin, end, globe.getEquatorialRadius(), globe.getPolarRadius()); assertEquals("Known ellipsoidal distance A", 638027.750, distance, TOLERANCE); }
public void testAntipodal() { // See // http://forum.worldwindcentral.com/showthread.php?45479-Potential-bug-in-ellipsoidalDistance LatLon begin = LatLon.fromDegrees(-12.720360910785889, 57.91244852568739); LatLon end = LatLon.fromDegrees(12.186856600402097, -121.90490684689753); double distance = LatLon.ellipsoidalDistance( begin, end, globe.getEquatorialRadius(), globe.getPolarRadius()); assertEquals("Antipodal", 1.9937004080007866E7, distance, TOLERANCE); }