private static double boundDelta(double minDelta, double maxDelta, double delta) {
    return Math.max(minDelta, Math.min(maxDelta, delta));
  }
private static double boundDelta(double minDelta, double maxDelta, double delta)