@Test public void testTrackDistance () { Position p0 = new Position(0, 0); Position p05 = new Position(0, 0.5); Position p1 = new Position(0, 1); Position p15 = new Position(0, 1.5); Position p2 = new Position(0, 2); Position p3 = new Position(0, 3); Position p4 = new Position(0, 4); double offset = p0.getAngularDistance(p1); GeodeticTrack base = new GeodeticTrack(GEODETIC_PARAMETERS, p0, p1, p2); GeodeticTrack unoffset = new GeodeticTrack(GEODETIC_PARAMETERS, p0, p1, p2); GeodeticTrack diffPoints = new GeodeticTrack(GEODETIC_PARAMETERS, p0, p05, p15, p2); GeodeticTrack hoffset = new GeodeticTrack(GEODETIC_PARAMETERS, p1, p2, p3); GeodeticTrack hoffset2 = new GeodeticTrack(GEODETIC_PARAMETERS, p2, p3, p4); GeodeticTrack voffset = new GeodeticTrack(GEODETIC_PARAMETERS, p0.offset(0, offset), p1.offset(0, offset), p2.offset(0, offset)); Assert.assertEquals(0.0, base.getDistance(unoffset), EPSILON); Assert.assertEquals(0.0, unoffset.getDistance(base), EPSILON); Assert.assertEquals(0.0, base.getDistance(diffPoints), EPSILON); Assert.assertEquals(0.0, diffPoints.getDistance(base), EPSILON); double hoffsetDistance = base.getDistance(hoffset); Assert.assertTrue(hoffsetDistance > EPSILON); Assert.assertEquals(hoffsetDistance, hoffset.getDistance(base), EPSILON); Assert.assertEquals(hoffsetDistance, base.getDistance(voffset), EPSILON); Assert.assertEquals(hoffsetDistance, voffset.getDistance(base), EPSILON); Assert.assertEquals(hoffsetDistance, base.getDistance(hoffset2) / 2.0, EPSILON); Assert.assertEquals(hoffsetDistance, hoffset2.getDistance(base) / 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();  }