package q;

import java.util.Arrays;

/* JADX INFO: renamed from: q.t, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2800t {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final float f23432a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final float f23433b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final float f23434c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final float f23435d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final float f23436e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final float f23437f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final float f23438g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public float f23439h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public float f23440i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final float[] f23441j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final float f23442k;
    public final float l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final float f23443m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final float f23444n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final float f23445o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final boolean f23446p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final float f23447q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final float f23448r;

    public C2800t(int i6, float f6, float f7, float f8, float f9, float f10, float f11) {
        boolean z6;
        int i7;
        float f12;
        this.f23432a = f6;
        this.f23433b = f7;
        this.f23434c = f8;
        this.f23435d = f9;
        this.f23436e = f10;
        this.f23437f = f11;
        float f13 = f10 - f8;
        float f14 = f11 - f9;
        float f15 = 0.0f;
        int i8 = 1;
        boolean z7 = i6 == 1 || (i6 == 4 ? f14 > 0.0f : !(i6 != 5 || f14 >= 0.0f));
        float f16 = z7 ? -1.0f : 1.0f;
        this.f23443m = f16;
        float f17 = 1 / (f7 - f6);
        this.f23442k = f17;
        this.f23441j = new float[101];
        boolean z8 = i6 == 3;
        if (z8 || Math.abs(f13) < 0.001f || Math.abs(f14) < 0.001f) {
            float fHypot = (float) Math.hypot(f14, f13);
            this.f23438g = fHypot;
            this.l = fHypot * f17;
            this.f23447q = f13 * f17;
            this.f23448r = f14 * f17;
            this.f23444n = Float.NaN;
            this.f23445o = Float.NaN;
            z6 = true;
        } else {
            this.f23444n = f13 * f16;
            this.f23445o = f14 * (-f16);
            this.f23447q = z7 ? f10 : f8;
            this.f23448r = z7 ? f9 : f11;
            float f18 = f10 - f8;
            float f19 = f9 - f11;
            float[] fArr = AbstractC2771e.f23305i;
            float f20 = 90;
            float f21 = f19;
            float fHypot2 = 0.0f;
            float f22 = 0.0f;
            int i9 = 1;
            while (true) {
                i7 = i8;
                float f23 = f21;
                double radians = (float) Math.toRadians((((double) i9) * 90.0d) / ((double) 90));
                float fSin = ((float) Math.sin(radians)) * f18;
                float fCos = ((float) Math.cos(radians)) * f19;
                f12 = f15;
                fHypot2 += (float) Math.hypot(fSin - f22, fCos - f23);
                fArr[i9] = fHypot2;
                if (i9 == 90) {
                    break;
                }
                i9++;
                f22 = fSin;
                f15 = f12;
                f21 = fCos;
                i8 = i7;
            }
            this.f23438g = fHypot2;
            int i10 = i7;
            while (true) {
                fArr[i10] = fArr[i10] / fHypot2;
                if (i10 == 90) {
                    break;
                } else {
                    i10++;
                }
            }
            float[] fArr2 = this.f23441j;
            int length = fArr2.length;
            for (int i11 = 0; i11 < length; i11++) {
                float f24 = i11 / 100.0f;
                int iBinarySearch = Arrays.binarySearch(fArr, 0, 91, f24);
                if (iBinarySearch >= 0) {
                    fArr2[i11] = iBinarySearch / f20;
                } else if (iBinarySearch == -1) {
                    fArr2[i11] = f12;
                } else {
                    int i12 = -iBinarySearch;
                    int i13 = i12 - 2;
                    float f25 = i13;
                    float f26 = fArr[i13];
                    fArr2[i11] = (((f24 - f26) / (fArr[i12 - 1] - f26)) + f25) / f20;
                }
            }
            this.l = this.f23438g * this.f23442k;
            z6 = z8;
        }
        this.f23446p = z6;
    }

    public final float a() {
        float f6 = this.f23444n * this.f23440i;
        return f6 * this.f23443m * (this.l / ((float) Math.hypot(f6, (-this.f23445o) * this.f23439h)));
    }

    public final float b() {
        float f6 = this.f23444n * this.f23440i;
        float f7 = (-this.f23445o) * this.f23439h;
        return f7 * this.f23443m * (this.l / ((float) Math.hypot(f6, f7)));
    }

    public final void c(float f6) {
        float f7 = (this.f23443m == -1.0f ? this.f23433b - f6 : f6 - this.f23432a) * this.f23442k;
        float fA = 0.0f;
        if (f7 > 0.0f) {
            fA = 1.0f;
            if (f7 < 1.0f) {
                float f8 = f7 * 100;
                int i6 = (int) f8;
                float[] fArr = this.f23441j;
                float f9 = fArr[i6];
                fA = com.google.android.recaptcha.internal.a.a(fArr[i6 + 1], f9, f8 - i6, f9);
            }
        }
        double d6 = fA * 1.5707964f;
        this.f23439h = (float) Math.sin(d6);
        this.f23440i = (float) Math.cos(d6);
    }
}
