@Override
    public double getClippedValue(double input, double clip) {
        double result = 0;
        double flag = 0;
        if (input >= a && input <= b) {
            flag = (input - a) / (b - a);
            if (result < clip) {
                result = flag;
            } else {
                result = clip;
            }
        }
        if (input >= b && input <= c) {
            flag = 1;
            if (flag < clip) {
                result = flag;
            } else {
                result = clip;
            }
        }
        if (input >= c && input <= d) {
            flag = (input - d) / (c - d);
        }
        if (flag < clip) {
            result = flag;
        } else {
            result = clip;
        }
        return result;
    }