package ῲ.㑃.K;

import ῲ.㑃.K.AbstractC2212;

/* renamed from: ῲ.㑃.K.㴹  reason: contains not printable characters */
/* compiled from: SpringForce */
public final class C2237 implements AbstractC2238 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean f7717 = false;

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

    /* renamed from: ᨨ  reason: contains not printable characters */
    public double f7719 = Double.MAX_VALUE;

    /* renamed from: ῲ  reason: contains not printable characters */
    public double f7720 = 0.5d;

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

    /* renamed from: K  reason: contains not printable characters */
    public double f7722 = Math.sqrt(1500.0d);

    /* renamed from: 㳳  reason: contains not printable characters */
    public final AbstractC2212.C2224 f7723 = new AbstractC2212.C2224();

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

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

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

    public C2237() {
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public C2237 m5861(float f) {
        if (f > 0.0f) {
            this.f7722 = Math.sqrt((double) f);
            this.f7717 = false;
            return this;
        }
        throw new IllegalArgumentException("Spring stiffness constant must be positive.");
    }

    /* renamed from: K  reason: contains not printable characters */
    public C2237 m5863(float f) {
        if (f >= 0.0f) {
            this.f7720 = (double) f;
            this.f7717 = false;
            return this;
        }
        throw new IllegalArgumentException("Damping ratio must be non-negative");
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m5865(float f, float f2) {
        return ((double) Math.abs(f2)) < this.f7718 && ((double) Math.abs(f - ((float) this.f7719))) < this.f7725;
    }

    public C2237(float f) {
        this.f7719 = (double) f;
    }

    /* renamed from: K  reason: contains not printable characters */
    public AbstractC2212.C2224 m5862(double d, double d2, long j) {
        double d3;
        double d4;
        if (!this.f7717) {
            if (this.f7719 != Double.MAX_VALUE) {
                double d5 = this.f7720;
                if (d5 > 1.0d) {
                    double d6 = this.f7722;
                    this.f7724 = (Math.sqrt((d5 * d5) - 1.0d) * d6) + ((-d5) * d6);
                    double d7 = this.f7720;
                    double d8 = this.f7722;
                    this.f7721 = ((-d7) * d8) - (Math.sqrt((d7 * d7) - 1.0d) * d8);
                } else if (d5 >= 0.0d && d5 < 1.0d) {
                    this.f7726 = Math.sqrt(1.0d - (d5 * d5)) * this.f7722;
                }
                this.f7717 = true;
            } else {
                throw new IllegalStateException("Error: Final position of the spring must be set before the animation starts");
            }
        }
        double d9 = ((double) j) / 1000.0d;
        double d10 = d - this.f7719;
        double d11 = this.f7720;
        if (d11 > 1.0d) {
            double d12 = this.f7721;
            double d13 = this.f7724;
            double d14 = d10 - (((d12 * d10) - d2) / (d12 - d13));
            double d15 = ((d10 * d12) - d2) / (d12 - d13);
            d3 = (Math.pow(2.718281828459045d, this.f7724 * d9) * d15) + (Math.pow(2.718281828459045d, d12 * d9) * d14);
            double d16 = this.f7721;
            double pow = Math.pow(2.718281828459045d, d16 * d9) * d14 * d16;
            double d17 = this.f7724;
            d4 = (Math.pow(2.718281828459045d, d17 * d9) * d15 * d17) + pow;
        } else if (d11 == 1.0d) {
            double d18 = this.f7722;
            double d19 = (d18 * d10) + d2;
            double d20 = (d19 * d9) + d10;
            double pow2 = Math.pow(2.718281828459045d, (-d18) * d9) * d20;
            double pow3 = Math.pow(2.718281828459045d, (-this.f7722) * d9) * d20;
            double d21 = this.f7722;
            d4 = (Math.pow(2.718281828459045d, (-d21) * d9) * d19) + (pow3 * (-d21));
            d3 = pow2;
        } else {
            double d22 = 1.0d / this.f7726;
            double d23 = this.f7722;
            double d24 = ((d11 * d23 * d10) + d2) * d22;
            double sin = ((Math.sin(this.f7726 * d9) * d24) + (Math.cos(this.f7726 * d9) * d10)) * Math.pow(2.718281828459045d, (-d11) * d23 * d9);
            double d25 = this.f7722;
            double d26 = this.f7720;
            double d27 = (-d25) * sin * d26;
            double pow4 = Math.pow(2.718281828459045d, (-d26) * d25 * d9);
            double d28 = this.f7726;
            double d29 = (-d28) * d10;
            double d30 = this.f7726;
            d4 = (((Math.cos(d30 * d9) * d24 * d30) + (Math.sin(d28 * d9) * d29)) * pow4) + d27;
            d3 = sin;
        }
        AbstractC2212.C2224 r1 = this.f7723;
        r1.f7704 = (float) (d3 + this.f7719);
        r1.f7703 = (float) d4;
        return r1;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5864(double d) {
        this.f7725 = Math.abs(d);
        this.f7718 = this.f7725 * 62.5d;
    }
}
