@Test public void testRange() throws FormatException{ double lat = ParseUtils.parseLatitude("61 00.000N"); double lon = ParseUtils.parseLongitude("051 00.000W"); Position start = Position.create(lat, lon); lat = ParseUtils.parseLatitude("61 03.530N"); lon = ParseUtils.parseLongitude("050 52.699W"); Position end = Position.create(lat, lon); double result = Calculator.range(start, end, Heading.RL); assertEquals(5.000017243489917, result, 0.0); }
public static double range(Position pos1, Position pos2, Heading heading) { double meters; if (heading == Heading.RL) { meters = pos1.rhumbLineDistanceTo(pos2); } else { meters = pos1.geodesicDistanceTo(pos2); } return Converter.metersToNm(meters); }
Calculator { public static double range(Position pos1, Position pos2, Heading heading) { double meters; if (heading == Heading.RL) { meters = pos1.rhumbLineDistanceTo(pos2); } else { meters = pos1.geodesicDistanceTo(pos2); } return Converter.metersToNm(meters); } }
Calculator { public static double range(Position pos1, Position pos2, Heading heading) { double meters; if (heading == Heading.RL) { meters = pos1.rhumbLineDistanceTo(pos2); } else { meters = pos1.geodesicDistanceTo(pos2); } return Converter.metersToNm(meters); }  }
Calculator { public static double range(Position pos1, Position pos2, Heading heading) { double meters; if (heading == Heading.RL) { meters = pos1.rhumbLineDistanceTo(pos2); } else { meters = pos1.geodesicDistanceTo(pos2); } return Converter.metersToNm(meters); }  static double crossTrackDistance(Position lineStart,
            Position lineEnd, Position point); static Position findCenterPosition(Position A, Position B,
            CoordinateSystem system); static double range(Position pos1, Position pos2, Heading heading); static double bearing(Position pos1, Position pos2, Heading heading); static double distanceAfterTimeMph(Double mph, long seconds); static Position findPosition(Position startingLocation,
            Position endLocation, double distanceTravelled); static Position findPosition(Position startingLocation,
            double bearing, double distanceTravelled); static Position calculateEndingGlobalCoordinates(
            Ellipsoid ellipsoid, Position start, double startBearing,
            double distance, double[] endBearing); static double turn90Plus(double direction); static double turn90Minus(double direction); static double reverseDirection(double direction); }
Calculator { public static double range(Position pos1, Position pos2, Heading heading) { double meters; if (heading == Heading.RL) { meters = pos1.rhumbLineDistanceTo(pos2); } else { meters = pos1.geodesicDistanceTo(pos2); } return Converter.metersToNm(meters); }  static double crossTrackDistance(Position lineStart,
            Position lineEnd, Position point); static Position findCenterPosition(Position A, Position B,
            CoordinateSystem system); static double range(Position pos1, Position pos2, Heading heading); static double bearing(Position pos1, Position pos2, Heading heading); static double distanceAfterTimeMph(Double mph, long seconds); static Position findPosition(Position startingLocation,
            Position endLocation, double distanceTravelled); static Position findPosition(Position startingLocation,
            double bearing, double distanceTravelled); static Position calculateEndingGlobalCoordinates(
            Ellipsoid ellipsoid, Position start, double startBearing,
            double distance, double[] endBearing); static double turn90Plus(double direction); static double turn90Minus(double direction); static double reverseDirection(double direction);  }