@Test public void testScaledTrackDistance () { Position p0 = new Position(0, 0); Position p1 = new Position(0, 1); Position p2 = new Position(0, 2); Position p4 = new Position(0, 4); double offset = p0.getAngularDistance(p1) / 10.0; GeodeticTrack smallA = new GeodeticTrack(GEODETIC_PARAMETERS, p0.offset(0, offset), p1.offset(0, offset), p2.offset(0, offset)); GeodeticTrack smallB = new GeodeticTrack(GEODETIC_PARAMETERS, p0.offset(180, offset), p1.offset(180, offset), p2.offset(180, offset)); GeodeticTrack thinA = new GeodeticTrack(GEODETIC_PARAMETERS, p0.offset(0, offset), p2.offset(0, offset), p4.offset(0, offset)); GeodeticTrack thinB = new GeodeticTrack(GEODETIC_PARAMETERS, p0.offset(180, offset), p2.offset(180, offset), p4.offset(180, offset)); GeodeticTrack largeA = new GeodeticTrack(GEODETIC_PARAMETERS, p0.offset(0, 2 * offset), p2.offset(0, 2 * offset), p4.offset(0, 2 * offset)); GeodeticTrack largeB = new GeodeticTrack(GEODETIC_PARAMETERS, p0.offset(180, 2 * offset), p2.offset(180, 2 * offset), p4.offset(180, 2 * offset)); double smallD = smallA.getDistance(smallB); double thinD = thinA.getDistance(thinB); double largeD = largeA.getDistance(largeB); Assert.assertEquals(smallD, largeD, EPSILON); Assert.assertEquals(smallD, thinD * 2.0, EPSILON); }
public double getDistance (Track them) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return getDistanceWithDirection(them.reverse()); else return getDistanceWithDirection(them); } else { return getDistanceWithDirection(them); } }
Track { public double getDistance (Track them) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return getDistanceWithDirection(them.reverse()); else return getDistanceWithDirection(them); } else { return getDistanceWithDirection(them); } } }
Track { public double getDistance (Track them) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return getDistanceWithDirection(them.reverse()); else return getDistanceWithDirection(them); } else { return getDistanceWithDirection(them); } } protected  Track(PositionCalculationParameters parameters, Position... points); protected  Track(PositionCalculationParameters parameters,
                     List<Position> points); protected  Track(PositionCalculationParameters parameters,
                     List<Position> points,
                     List<Double> parameterization); protected  Track(Track oldTrack, PositionCalculationParameters newParameters); }
Track { public double getDistance (Track them) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return getDistanceWithDirection(them.reverse()); else return getDistanceWithDirection(them); } else { return getDistanceWithDirection(them); } } protected  Track(PositionCalculationParameters parameters, Position... points); protected  Track(PositionCalculationParameters parameters,
                     List<Position> points); protected  Track(PositionCalculationParameters parameters,
                     List<Position> points,
                     List<Double> parameterization); protected  Track(Track oldTrack, PositionCalculationParameters newParameters); Track reverse(); PositionCalculationParameters getParameters(); List<Position> getPoints(); double getLength(); double getDistance(Track them); Track weightedAverage(Track them, double ourWeight, double theirWeight); @Override String toString(); @Override boolean equals(Object that); void addStatistic(String statName, double stat); Map<String, Double> getStatistics(); }
Track { public double getDistance (Track them) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return getDistanceWithDirection(them.reverse()); else return getDistanceWithDirection(them); } else { return getDistanceWithDirection(them); } } protected  Track(PositionCalculationParameters parameters, Position... points); protected  Track(PositionCalculationParameters parameters,
                     List<Position> points); protected  Track(PositionCalculationParameters parameters,
                     List<Position> points,
                     List<Double> parameterization); protected  Track(Track oldTrack, PositionCalculationParameters newParameters); Track reverse(); PositionCalculationParameters getParameters(); List<Position> getPoints(); double getLength(); double getDistance(Track them); Track weightedAverage(Track them, double ourWeight, double theirWeight); @Override String toString(); @Override boolean equals(Object that); void addStatistic(String statName, double stat); Map<String, Double> getStatistics();  }