package J2;

/* JADX INFO: loaded from: classes.dex */
public final class u0 {

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

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

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

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f3464e = false;

    public u0(float f6, float f7, float f8, float f9) {
        this.f3462c = 0.0f;
        this.f3463d = 0.0f;
        this.f3460a = f6;
        this.f3461b = f7;
        double dSqrt = Math.sqrt((f9 * f9) + (f8 * f8));
        if (dSqrt != 0.0d) {
            this.f3462c = (float) (((double) f8) / dSqrt);
            this.f3463d = (float) (((double) f9) / dSqrt);
        }
    }

    public final void a(float f6, float f7) {
        float f8 = f6 - this.f3460a;
        float f9 = f7 - this.f3461b;
        double dSqrt = Math.sqrt((f9 * f9) + (f8 * f8));
        if (dSqrt != 0.0d) {
            f8 = (float) (((double) f8) / dSqrt);
            f9 = (float) (((double) f9) / dSqrt);
        }
        float f10 = this.f3462c;
        if (f8 != (-f10) || f9 != (-this.f3463d)) {
            this.f3462c = f10 + f8;
            this.f3463d += f9;
        } else {
            this.f3464e = true;
            this.f3462c = -f9;
            this.f3463d = f8;
        }
    }

    public final void b(u0 u0Var) {
        float f6 = u0Var.f3462c;
        float f7 = this.f3462c;
        if (f6 == (-f7)) {
            float f8 = u0Var.f3463d;
            if (f8 == (-this.f3463d)) {
                this.f3464e = true;
                this.f3462c = -f8;
                this.f3463d = u0Var.f3462c;
                return;
            }
        }
        this.f3462c = f7 + f6;
        this.f3463d += u0Var.f3463d;
    }

    public final String toString() {
        return "(" + this.f3460a + "," + this.f3461b + " " + this.f3462c + "," + this.f3463d + ")";
    }
}
