@Test public void testTrackAveraging () { Position pa0 = new Position(0.0, 0.0); Position pa1 = new Position(1.0, 0.0); Position pa2 = new Position(2.0, 0.0); Track ta = new GeodeticTrack(GEODETIC_PARAMETERS, pa0, pa1, pa2); Position pb0 = new Position(0.0, 1.0); Position pb1 = new Position(1.0, 1.0); Position pb2 = new Position(2.0, 1.0); Track tb = new GeodeticTrack(GEODETIC_PARAMETERS, pb0, pb1, pb2); Position pc0 = new Position(0.0, -1.0); Position pc1 = new Position(1.0, -1.0); Position pc2 = new Position(2.0, -1.0); Track tc = new GeodeticTrack(GEODETIC_PARAMETERS, pc0, pc1, pc2); Assert.assertEquals(ta, tb.weightedAverage(tc, 1, 1)); Assert.assertEquals(ta, tc.weightedAverage(tb, 1, 1)); Assert.assertEquals(ta, ta.weightedAverage(tb.weightedAverage(tc, 1, 1), 1, 2)); Assert.assertEquals(ta, ta.weightedAverage(tc.weightedAverage(tb, 1, 1), 1, 2)); Assert.assertEquals(ta, tb.weightedAverage(ta.weightedAverage(tc, 1, 1), 1, 2)); Assert.assertEquals(ta, tb.weightedAverage(tc.weightedAverage(ta, 1, 1), 1, 2)); Assert.assertEquals(ta, tc.weightedAverage(ta.weightedAverage(tb, 1, 1), 1, 2)); Assert.assertEquals(ta, tc.weightedAverage(tb.weightedAverage(ta, 1, 1), 1, 2)); }
public Track weightedAverage (Track them, double ourWeight, double theirWeight) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return weightedAverageWithDirection(them.reverse(), ourWeight, theirWeight); else return weightedAverageWithDirection(them, ourWeight, theirWeight); } else { return weightedAverageWithDirection(them, ourWeight, theirWeight); } }
Track { public Track weightedAverage (Track them, double ourWeight, double theirWeight) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return weightedAverageWithDirection(them.reverse(), ourWeight, theirWeight); else return weightedAverageWithDirection(them, ourWeight, theirWeight); } else { return weightedAverageWithDirection(them, ourWeight, theirWeight); } } }
Track { public Track weightedAverage (Track them, double ourWeight, double theirWeight) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return weightedAverageWithDirection(them.reverse(), ourWeight, theirWeight); else return weightedAverageWithDirection(them, ourWeight, theirWeight); } else { return weightedAverageWithDirection(them, ourWeight, theirWeight); } } 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 Track weightedAverage (Track them, double ourWeight, double theirWeight) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return weightedAverageWithDirection(them.reverse(), ourWeight, theirWeight); else return weightedAverageWithDirection(them, ourWeight, theirWeight); } else { return weightedAverageWithDirection(them, ourWeight, theirWeight); } } 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 Track weightedAverage (Track them, double ourWeight, double theirWeight) { if (_parameters.ignoreDirection()) { if (closerToReverse(them)) return weightedAverageWithDirection(them.reverse(), ourWeight, theirWeight); else return weightedAverageWithDirection(them, ourWeight, theirWeight); } else { return weightedAverageWithDirection(them, ourWeight, theirWeight); } } 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();  }