code: private static List<Point> simplifyRadialDist(List<Point> points, double sqTolerance) {
      Point prevPoint = points.get(0);
      ArrayList<Point> newPoints = new ArrayList<>();
      newPoints.add(prevPoint);
      Point point = null;
  
      for (int i = 1, len = points.size(); i < len; i++) {
        point = points.get(i);
  
        if (getSqDist(point, prevPoint) > sqTolerance) {
          newPoints.add(point);
          prevPoint = point;
        }
      }
  
      if (!prevPoint.equals(point)) {
        newPoints.add(point);
      }
      return newPoints;
    }
docs: Basic distance-based simplification.
  
  @param points a list of points to be simplified
  @param sqTolerance square of amount of simplification
  @return a list of simplified points