package X6FRs_4.IMuAHx_6.EuDEkJe_12.EANXC_30;

import android.graphics.Path;
import android.graphics.PathMeasure;
import android.view.animation.Interpolator;
/* compiled from: PathInterpolatorApi14.java */
/* loaded from: classes.dex */
public class KQgRr5e_0 implements Interpolator {
    public final float[] KQgRr5e_0;
    public final float[] QxJ9d_1;

    public KQgRr5e_0(Path path) {
        PathMeasure pathMeasure = new PathMeasure(path, false);
        float length = pathMeasure.getLength();
        int i = ((int) (length / 0.002f)) + 1;
        this.KQgRr5e_0 = new float[i];
        this.QxJ9d_1 = new float[i];
        float[] fArr = new float[2];
        for (int i2 = 0; i2 < i; i2++) {
            pathMeasure.getPosTan((i2 * length) / (i - 1), fArr, null);
            this.KQgRr5e_0[i2] = fArr[0];
            this.QxJ9d_1[i2] = fArr[1];
        }
    }

    public static Path KQgRr5e_0(float f, float f2) {
        Path path = new Path();
        path.moveTo(0.0f, 0.0f);
        path.quadTo(f, f2, 1.0f, 1.0f);
        return path;
    }

    @Override // android.animation.TimeInterpolator
    public float getInterpolation(float f) {
        if (f <= 0.0f) {
            return 0.0f;
        }
        if (f >= 1.0f) {
            return 1.0f;
        }
        int i = 0;
        int length = this.KQgRr5e_0.length - 1;
        while (length - i > 1) {
            int i2 = (i + length) / 2;
            if (f < this.KQgRr5e_0[i2]) {
                length = i2;
            } else {
                i = i2;
            }
        }
        float[] fArr = this.KQgRr5e_0;
        float f2 = fArr[length] - fArr[i];
        if (f2 == 0.0f) {
            return this.QxJ9d_1[i];
        }
        float[] fArr2 = this.QxJ9d_1;
        float f3 = fArr2[i];
        return f3 + (((f - fArr[i]) / f2) * (fArr2[length] - f3));
    }

    public KQgRr5e_0(float f, float f2) {
        this(KQgRr5e_0(f, f2));
    }
}
