@Test public void testApproximation() { float[] points = new float[]{ 10, 20, 20, 30, 25, 25, 30, 28, 31, 31, 33, 33, 40, 40, 44, 40, 48, 23, 50, 20, 55, 20, 60, 25}; assertEquals(24, points.length); Approximator a = new Approximator(); float[] reduced = a.reduceWithDouglasPeucker(points, 2); assertEquals(18, reduced.length); }
/** * Enables data filtering for the chart data, filtering will use the user * customized Approximator handed over to this method. * * @param a */ public void enableFiltering(Approximator a) { mFilterData = true; // mApproximator = a; }