package androidx.transition;

import X6FRs_4.IMuAHx_6.X6FRs_4.PGPF6hQ_2.IMuAHx_6;
import X6FRs_4.JZJr_16.NQvZgp_17;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Path;
import android.util.AttributeSet;
import org.xmlpull.v1.XmlPullParser;
/* loaded from: classes.dex */
public class ArcMotion extends PathMotion {

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public static final float f3576Mqv2r_3 = (float) Math.tan(Math.toRadians(35.0d));
    public float KQgRr5e_0;
    public float PGPF6hQ_2;
    public float QxJ9d_1;

    public ArcMotion() {
        this.KQgRr5e_0 = 0.0f;
        this.QxJ9d_1 = 0.0f;
        this.PGPF6hQ_2 = f3576Mqv2r_3;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m985KQgRr5e_0(float f) {
        this.PGPF6hQ_2 = KQgRr5e_0(f);
    }

    public void PGPF6hQ_2(float f) {
        this.QxJ9d_1 = KQgRr5e_0(f);
    }

    public void QxJ9d_1(float f) {
        this.KQgRr5e_0 = KQgRr5e_0(f);
    }

    public static float KQgRr5e_0(float f) {
        if (f >= 0.0f && f <= 90.0f) {
            return (float) Math.tan(Math.toRadians(f / 2.0f));
        }
        throw new IllegalArgumentException("Arc must be between 0 and 90 degrees");
    }

    @Override // androidx.transition.PathMotion
    public Path KQgRr5e_0(float f, float f2, float f3, float f4) {
        float f5;
        float f6;
        float f7;
        Path path = new Path();
        path.moveTo(f, f2);
        float f8 = f3 - f;
        float f9 = f4 - f2;
        float f10 = (f8 * f8) + (f9 * f9);
        float f11 = (f + f3) / 2.0f;
        float f12 = (f2 + f4) / 2.0f;
        float f13 = 0.25f * f10;
        boolean z = f2 > f4;
        if (Math.abs(f8) < Math.abs(f9)) {
            float abs = Math.abs(f10 / (f9 * 2.0f));
            if (z) {
                f6 = abs + f4;
                f5 = f3;
            } else {
                f6 = abs + f2;
                f5 = f;
            }
            f7 = this.QxJ9d_1;
        } else {
            float f14 = f10 / (f8 * 2.0f);
            if (z) {
                f6 = f2;
                f5 = f14 + f;
            } else {
                f5 = f3 - f14;
                f6 = f4;
            }
            f7 = this.KQgRr5e_0;
        }
        float f15 = f13 * f7 * f7;
        float f16 = f11 - f5;
        float f17 = f12 - f6;
        float f18 = (f16 * f16) + (f17 * f17);
        float f19 = this.PGPF6hQ_2;
        float f20 = f13 * f19 * f19;
        if (f18 >= f15) {
            f15 = f18 > f20 ? f20 : 0.0f;
        }
        if (f15 != 0.0f) {
            float sqrt = (float) Math.sqrt(f15 / f18);
            f5 = ((f5 - f11) * sqrt) + f11;
            f6 = f12 + (sqrt * (f6 - f12));
        }
        path.cubicTo((f + f5) / 2.0f, (f2 + f6) / 2.0f, (f5 + f3) / 2.0f, (f6 + f4) / 2.0f, f3, f4);
        return path;
    }

    public ArcMotion(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.KQgRr5e_0 = 0.0f;
        this.QxJ9d_1 = 0.0f;
        this.PGPF6hQ_2 = f3576Mqv2r_3;
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, NQvZgp_17.f3130FSaI4_7);
        XmlPullParser xmlPullParser = (XmlPullParser) attributeSet;
        PGPF6hQ_2(IMuAHx_6.KQgRr5e_0(obtainStyledAttributes, xmlPullParser, "minimumVerticalAngle", 1, 0.0f));
        QxJ9d_1(IMuAHx_6.KQgRr5e_0(obtainStyledAttributes, xmlPullParser, "minimumHorizontalAngle", 0, 0.0f));
        m985KQgRr5e_0(IMuAHx_6.KQgRr5e_0(obtainStyledAttributes, xmlPullParser, "maximumAngle", 2, 70.0f));
        obtainStyledAttributes.recycle();
    }
}
