Position extends Location { public Position interpolateAlongPath(Position endPosition, @WorldWind.PathType int pathType, double amount, Position result) { if (endPosition == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Position", "interpolateAlongPath", "missingPosition")); } if (result == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Position", "interpolateAlongPath", "missingResult")); } super.interpolateAlongPath(endPosition, pathType, amount, result); result.altitude = (1 - amount) * this.altitude + amount * endPosition.altitude; return result; } Position();  Position(double latitude, double longitude, double altitude);  Position(Position position); static Position fromDegrees(double latitudeDegrees, double longitudeDegrees, double altitude); static Position fromRadians(double latitudeRadians, double longitudeRadians, double altitude); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Position set(double latitude, double longitude, double altitude); Position set(Position position); Position interpolateAlongPath(Position endPosition, @WorldWind.PathType int pathType, double amount,
                                         Position result); public double altitude; }
@Test public void testInterpolateAlongPath() throws Exception { Position lax = Position.fromDegrees(33.94, -118.4, 38.7); Position oxr = Position.fromDegrees(34.2, -119.2, 13.7); double distanceToOxr = lax.greatCircleDistance(oxr); double azimuthToOxr = lax.greatCircleAzimuth(oxr); double amount = 0.25; Position result = lax.interpolateAlongPath(oxr, WorldWind.GREAT_CIRCLE, amount, new Position()); double distanceToResult = lax.greatCircleDistance(result); Location test = lax.greatCircleLocation(azimuthToOxr, distanceToResult, new Location()); assertEquals("interpolated distance", distanceToOxr * amount, distanceToResult, TOLERANCE); assertEquals("latitude", test.latitude, result.latitude, 0); assertEquals("longitude", test.longitude, result.longitude, 0); }