package com.tencent.mm.plugin.appbrand.jsapi.container;

import android.graphics.PointF;
import android.view.animation.Interpolator;
import com.tencent.matrix.trace.core.AppMethodBeat;

public class c$a implements Interpolator {
    protected PointF a;
    protected PointF b;
    final /* synthetic */ c hIP;
    private int hIQ;
    private final PointF hIR;
    private final PointF hIS;
    protected PointF hIT;
    protected PointF hIU;
    protected PointF hIV;

    private c$a(c cVar, PointF pointF, PointF pointF2) {
        this.hIP = cVar;
        AppMethodBeat.i(126283);
        this.hIQ = 0;
        this.hIR = new PointF();
        this.hIS = new PointF();
        this.a = new PointF();
        this.b = new PointF();
        this.hIV = new PointF();
        IllegalArgumentException illegalArgumentException;
        if (pointF.x < 0.0f || pointF.x > 1.0f) {
            illegalArgumentException = new IllegalArgumentException("startX value must be in the range [0, 1]");
            AppMethodBeat.o(126283);
            throw illegalArgumentException;
        } else if (pointF2.x < 0.0f || pointF2.x > 1.0f) {
            illegalArgumentException = new IllegalArgumentException("endX value must be in the range [0, 1]");
            AppMethodBeat.o(126283);
            throw illegalArgumentException;
        } else {
            this.hIT = pointF;
            this.hIU = pointF2;
            AppMethodBeat.o(126283);
        }
    }

    public c$a(c cVar) {
        this(cVar, new PointF(0.0f, 0.0f), new PointF(0.58f, 1.0f));
        AppMethodBeat.i(126284);
        AppMethodBeat.o(126284);
    }

    public final float getInterpolation(float f) {
        AppMethodBeat.i(126285);
        float f2 = f;
        for (int i = 1; i < 14; i++) {
            this.hIV.x = this.hIT.x * 3.0f;
            this.b.x = ((this.hIU.x - this.hIT.x) * 3.0f) - this.hIV.x;
            this.a.x = (1.0f - this.hIV.x) - this.b.x;
            float f3 = ((this.hIV.x + ((this.b.x + (this.a.x * f2)) * f2)) * f2) - f;
            if (((double) Math.abs(f3)) < 0.001d) {
                break;
            }
            f2 -= f3 / (this.hIV.x + (((2.0f * this.b.x) + ((this.a.x * 3.0f) * f2)) * f2));
        }
        this.hIV.y = this.hIT.y * 3.0f;
        this.b.y = ((this.hIU.y - this.hIT.y) * 3.0f) - this.hIV.y;
        this.a.y = (1.0f - this.hIV.y) - this.b.y;
        float f4 = (this.hIV.y + ((this.b.y + (this.a.y * f2)) * f2)) * f2;
        AppMethodBeat.o(126285);
        return f4;
    }
}
