package ῲ.ⁱ.K.K;

import java.util.Arrays;

/* renamed from: ῲ.ⁱ.K.K.K  reason: contains not printable characters */
/* compiled from: ArcCurveFit */
public class C2190 extends AbstractC2187 {

    /* renamed from: ῲ  reason: contains not printable characters */
    public C2191[] f7621;

    /* renamed from: K  reason: contains not printable characters */
    public final double[] f7622;

    public C2190(int[] iArr, double[] dArr, double[][] dArr2) {
        this.f7622 = dArr;
        this.f7621 = new C2191[(dArr.length - 1)];
        int i = 0;
        int i2 = 1;
        int i3 = 1;
        while (i < this.f7621.length) {
            int i4 = iArr[i];
            int i5 = 2;
            if (i4 == 0) {
                i5 = 3;
            } else if (i4 == 1) {
                i2 = 1;
                i5 = 1;
            } else if (i4 == 2) {
                i2 = 2;
            } else if (i4 != 3) {
                i5 = i3;
            } else {
                i5 = i2 != 1 ? 1 : i5;
                i2 = i5;
            }
            int i6 = i + 1;
            this.f7621[i] = new C2191(i5, dArr[i], dArr[i6], dArr2[i][0], dArr2[i][1], dArr2[i6][0], dArr2[i6][1]);
            i = i6;
            i3 = i5;
        }
    }

    @Override // ῲ.ⁱ.K.K.AbstractC2187
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m5754(double d, double[] dArr) {
        C2191[] kArr = this.f7621;
        if (d < kArr[0].f7624) {
            d = kArr[0].f7624;
        } else if (d > kArr[kArr.length - 1].f7639) {
            d = kArr[kArr.length - 1].f7639;
        }
        int i = 0;
        while (true) {
            C2191[] kArr2 = this.f7621;
            if (i >= kArr2.length) {
                return;
            }
            if (d > kArr2[i].f7639) {
                i++;
            } else if (kArr2[i].f7636) {
                dArr[0] = kArr2[i].f7634;
                dArr[1] = kArr2[i].f7641;
                return;
            } else {
                kArr2[i].m5760(d);
                dArr[0] = this.f7621[i].m5763();
                dArr[1] = this.f7621[i].m5761();
                return;
            }
        }
    }

    @Override // ῲ.ⁱ.K.K.AbstractC2187
    /* renamed from: K  reason: contains not printable characters */
    public void m5756(double d, double[] dArr) {
        C2191[] kArr = this.f7621;
        if (d < kArr[0].f7624) {
            d = kArr[0].f7624;
        }
        C2191[] kArr2 = this.f7621;
        if (d > kArr2[kArr2.length - 1].f7639) {
            d = kArr2[kArr2.length - 1].f7639;
        }
        int i = 0;
        while (true) {
            C2191[] kArr3 = this.f7621;
            if (i >= kArr3.length) {
                return;
            }
            if (d > kArr3[i].f7639) {
                i++;
            } else if (kArr3[i].f7636) {
                dArr[0] = kArr3[i].m5764(d);
                dArr[1] = this.f7621[i].m5762(d);
                return;
            } else {
                kArr3[i].m5760(d);
                dArr[0] = this.f7621[i].m5759();
                dArr[1] = this.f7621[i].m5765();
                return;
            }
        }
    }

    /* renamed from: ῲ.ⁱ.K.K.K$K  reason: contains not printable characters */
    /* compiled from: ArcCurveFit */
    public static class C2191 {

        /* renamed from: ݜ  reason: contains not printable characters */
        public static double[] f7623 = new double[91];

        /* renamed from: ʬ  reason: contains not printable characters */
        public double f7624;

        /* renamed from: Ԕ  reason: contains not printable characters */
        public double f7625;

        /* renamed from: ؿ  reason: contains not printable characters */
        public double f7626;

        /* renamed from: ඓ  reason: contains not printable characters */
        public double f7627;

        /* renamed from: ᓣ  reason: contains not printable characters */
        public boolean f7628;

        /* renamed from: ᕣ  reason: contains not printable characters */
        public double f7629;

        /* renamed from: ᨨ  reason: contains not printable characters */
        public double f7630;

        /* renamed from: ῲ  reason: contains not printable characters */
        public double f7631;

        /* renamed from: ⁱ  reason: contains not printable characters */
        public double f7632;

        /* renamed from: K  reason: contains not printable characters */
        public double[] f7633;

        /* renamed from: 㑃  reason: contains not printable characters */
        public double f7634;

        /* renamed from: 㗗  reason: contains not printable characters */
        public double f7635;

        /* renamed from: 㗽  reason: contains not printable characters */
        public boolean f7636 = false;

        /* renamed from: 㳳  reason: contains not printable characters */
        public double f7637;

        /* renamed from: 㴹  reason: contains not printable characters */
        public double f7638;

        /* renamed from: 㸾  reason: contains not printable characters */
        public double f7639;

        /* renamed from: 㿎  reason: contains not printable characters */
        public double f7640;

        /* renamed from: 䁗  reason: contains not printable characters */
        public double f7641;

        public C2191(int i, double d, double d2, double d3, double d4, double d5, double d6) {
            double d7 = d3;
            this.f7628 = i == 1;
            this.f7624 = d;
            this.f7639 = d2;
            this.f7630 = 1.0d / (this.f7639 - this.f7624);
            if (3 == i) {
                this.f7636 = true;
            }
            double d8 = d5 - d7;
            double d9 = d6 - d4;
            if (this.f7636 || Math.abs(d8) < 0.001d || Math.abs(d9) < 0.001d) {
                this.f7636 = true;
                this.f7627 = d7;
                this.f7638 = d5;
                this.f7632 = d4;
                this.f7640 = d6;
                this.f7631 = Math.hypot(d9, d8);
                this.f7625 = this.f7631 * this.f7630;
                double d10 = this.f7639;
                double d11 = this.f7624;
                this.f7634 = d8 / (d10 - d11);
                this.f7641 = d9 / (d10 - d11);
                return;
            }
            this.f7633 = new double[101];
            this.f7637 = ((double) (this.f7628 ? -1 : 1)) * d8;
            this.f7629 = d9 * ((double) (this.f7628 ? 1 : -1));
            this.f7634 = this.f7628 ? d5 : d7;
            this.f7641 = this.f7628 ? d4 : d6;
            double d12 = d4 - d6;
            int i2 = 0;
            double d13 = 0.0d;
            double d14 = 0.0d;
            double d15 = 0.0d;
            while (true) {
                double[] dArr = f7623;
                if (i2 >= dArr.length) {
                    break;
                }
                double radians = Math.toRadians((((double) i2) * 90.0d) / ((double) (dArr.length - 1)));
                double sin = Math.sin(radians) * d8;
                double cos = Math.cos(radians) * d12;
                if (i2 > 0) {
                    double hypot = Math.hypot(sin - d14, cos - d15) + d13;
                    f7623[i2] = hypot;
                    d13 = hypot;
                }
                i2++;
                d15 = cos;
                d14 = sin;
            }
            this.f7631 = d13;
            int i3 = 0;
            while (true) {
                double[] dArr2 = f7623;
                if (i3 >= dArr2.length) {
                    break;
                }
                dArr2[i3] = dArr2[i3] / d13;
                i3++;
            }
            int i4 = 0;
            while (true) {
                double[] dArr3 = this.f7633;
                if (i4 < dArr3.length) {
                    double length = ((double) i4) / ((double) (dArr3.length - 1));
                    int binarySearch = Arrays.binarySearch(f7623, length);
                    if (binarySearch >= 0) {
                        this.f7633[i4] = (double) (binarySearch / (f7623.length - 1));
                    } else if (binarySearch == -1) {
                        this.f7633[i4] = 0.0d;
                    } else {
                        int i5 = -binarySearch;
                        int i6 = i5 - 2;
                        double[] dArr4 = f7623;
                        this.f7633[i4] = (((length - dArr4[i6]) / (dArr4[i5 - 1] - dArr4[i6])) + ((double) i6)) / ((double) (dArr4.length - 1));
                    }
                    i4++;
                } else {
                    this.f7625 = this.f7631 * this.f7630;
                    return;
                }
            }
        }

        /* renamed from: ʬ  reason: contains not printable characters */
        public void m5760(double d) {
            double d2 = (this.f7628 ? this.f7639 - d : d - this.f7624) * this.f7630;
            double d3 = 0.0d;
            if (d2 > 0.0d) {
                d3 = 1.0d;
                if (d2 < 1.0d) {
                    double[] dArr = this.f7633;
                    double length = d2 * ((double) (dArr.length - 1));
                    int i = (int) length;
                    d3 = ((dArr[i + 1] - dArr[i]) * (length - ((double) i))) + dArr[i];
                }
            }
            double d4 = d3 * 1.5707963267948966d;
            this.f7635 = Math.sin(d4);
            this.f7626 = Math.cos(d4);
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public double m5761() {
            double d = this.f7637 * this.f7626;
            double d2 = (-this.f7629) * this.f7635;
            double hypot = this.f7625 / Math.hypot(d, d2);
            return this.f7628 ? (-d2) * hypot : d2 * hypot;
        }

        /* renamed from: K  reason: contains not printable characters */
        public double m5763() {
            double d = this.f7637 * this.f7626;
            double hypot = this.f7625 / Math.hypot(d, (-this.f7629) * this.f7635);
            if (this.f7628) {
                d = -d;
            }
            return d * hypot;
        }

        /* renamed from: 㸾  reason: contains not printable characters */
        public double m5765() {
            return (this.f7629 * this.f7626) + this.f7641;
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public double m5762(double d) {
            double d2 = (d - this.f7624) * this.f7630;
            double d3 = this.f7632;
            return ((this.f7640 - d3) * d2) + d3;
        }

        /* renamed from: K  reason: contains not printable characters */
        public double m5764(double d) {
            double d2 = (d - this.f7624) * this.f7630;
            double d3 = this.f7627;
            return ((this.f7638 - d3) * d2) + d3;
        }

        /* renamed from: ʬ  reason: contains not printable characters */
        public double m5759() {
            return (this.f7637 * this.f7635) + this.f7634;
        }
    }

    @Override // ῲ.ⁱ.K.K.AbstractC2187
    /* renamed from: K  reason: contains not printable characters */
    public void m5757(double d, float[] fArr) {
        C2191[] kArr = this.f7621;
        if (d < kArr[0].f7624) {
            d = kArr[0].f7624;
        } else if (d > kArr[kArr.length - 1].f7639) {
            d = kArr[kArr.length - 1].f7639;
        }
        int i = 0;
        while (true) {
            C2191[] kArr2 = this.f7621;
            if (i >= kArr2.length) {
                return;
            }
            if (d > kArr2[i].f7639) {
                i++;
            } else if (kArr2[i].f7636) {
                fArr[0] = (float) kArr2[i].m5764(d);
                fArr[1] = (float) this.f7621[i].m5762(d);
                return;
            } else {
                kArr2[i].m5760(d);
                fArr[0] = (float) this.f7621[i].m5759();
                fArr[1] = (float) this.f7621[i].m5765();
                return;
            }
        }
    }

    @Override // ῲ.ⁱ.K.K.AbstractC2187
    /* renamed from: ῲ  reason: contains not printable characters */
    public double m5753(double d, int i) {
        C2191[] kArr = this.f7621;
        int i2 = 0;
        if (d < kArr[0].f7624) {
            d = kArr[0].f7624;
        }
        C2191[] kArr2 = this.f7621;
        if (d > kArr2[kArr2.length - 1].f7639) {
            d = kArr2[kArr2.length - 1].f7639;
        }
        while (true) {
            C2191[] kArr3 = this.f7621;
            if (i2 >= kArr3.length) {
                return Double.NaN;
            }
            if (d > kArr3[i2].f7639) {
                i2++;
            } else if (!kArr3[i2].f7636) {
                kArr3[i2].m5760(d);
                if (i == 0) {
                    return this.f7621[i2].m5763();
                }
                return this.f7621[i2].m5761();
            } else if (i == 0) {
                return kArr3[i2].f7634;
            } else {
                return kArr3[i2].f7641;
            }
        }
    }

    @Override // ῲ.ⁱ.K.K.AbstractC2187
    /* renamed from: K  reason: contains not printable characters */
    public double m5755(double d, int i) {
        C2191[] kArr = this.f7621;
        int i2 = 0;
        if (d < kArr[0].f7624) {
            d = kArr[0].f7624;
        } else if (d > kArr[kArr.length - 1].f7639) {
            d = kArr[kArr.length - 1].f7639;
        }
        while (true) {
            C2191[] kArr2 = this.f7621;
            if (i2 >= kArr2.length) {
                return Double.NaN;
            }
            if (d > kArr2[i2].f7639) {
                i2++;
            } else if (!kArr2[i2].f7636) {
                kArr2[i2].m5760(d);
                if (i == 0) {
                    return this.f7621[i2].m5759();
                }
                return this.f7621[i2].m5765();
            } else if (i == 0) {
                return kArr2[i2].m5764(d);
            } else {
                return kArr2[i2].m5762(d);
            }
        }
    }

    @Override // ῲ.ⁱ.K.K.AbstractC2187
    /* renamed from: K  reason: contains not printable characters */
    public double[] m5758() {
        return this.f7622;
    }
}
