package com.google.android.material.bottomappbar;

import c1.f;
import c1.m;

/* JADX INFO: compiled from: BottomAppBarTopEdgeTreatment.java */
/* JADX INFO: loaded from: classes.dex */
public class a extends f implements Cloneable {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private float f3636e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private float f3637f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private float f3638g;

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

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private float f3641j;

    @Override // c1.f
    public void b(float f3, float f4, float f5, m mVar) {
        float f6;
        float f7;
        float f8 = this.f3638g;
        if (f8 == 0.0f) {
            mVar.m(f3, 0.0f);
            return;
        }
        float f9 = ((this.f3637f * 2.0f) + f8) / 2.0f;
        float f10 = f5 * this.f3636e;
        float f11 = f4 + this.f3640i;
        float f12 = (this.f3639h * f5) + ((1.0f - f5) * f9);
        if (f12 / f9 >= 1.0f) {
            mVar.m(f3, 0.0f);
            return;
        }
        float f13 = this.f3641j;
        float f14 = f13 * f5;
        boolean z2 = f13 == -1.0f || Math.abs((f13 * 2.0f) - f8) < 0.1f;
        if (z2) {
            f6 = f12;
            f7 = 0.0f;
        } else {
            f7 = 1.75f;
            f6 = 0.0f;
        }
        float f15 = f9 + f10;
        float f16 = f6 + f10;
        float fSqrt = (float) Math.sqrt((f15 * f15) - (f16 * f16));
        float f17 = f11 - fSqrt;
        float f18 = f11 + fSqrt;
        float degrees = (float) Math.toDegrees(Math.atan(fSqrt / f16));
        float f19 = (90.0f - degrees) + f7;
        mVar.m(f17, 0.0f);
        float f20 = f10 * 2.0f;
        mVar.a(f17 - f10, 0.0f, f17 + f10, f20, 270.0f, degrees);
        if (z2) {
            mVar.a(f11 - f9, (-f9) - f6, f11 + f9, f9 - f6, 180.0f - f19, (f19 * 2.0f) - 180.0f);
        } else {
            float f21 = this.f3637f;
            float f22 = f14 * 2.0f;
            float f23 = f11 - f9;
            mVar.a(f23, -(f14 + f21), f23 + f21 + f22, f21 + f14, 180.0f - f19, ((f19 * 2.0f) - 180.0f) / 2.0f);
            float f24 = f11 + f9;
            float f25 = this.f3637f;
            mVar.m(f24 - ((f25 / 2.0f) + f14), f25 + f14);
            float f26 = this.f3637f;
            mVar.a(f24 - (f22 + f26), -(f14 + f26), f24, f26 + f14, 90.0f, f19 - 90.0f);
        }
        mVar.a(f18 - f10, 0.0f, f18 + f10, f20, 270.0f - degrees, degrees);
        mVar.m(f3, 0.0f);
    }

    float c() {
        return this.f3639h;
    }

    public float d() {
        return this.f3641j;
    }

    float e() {
        return this.f3637f;
    }

    float f() {
        return this.f3636e;
    }

    public float g() {
        return this.f3638g;
    }

    void h(float f3) {
        if (f3 < 0.0f) {
            throw new IllegalArgumentException("cradleVerticalOffset must be positive.");
        }
        this.f3639h = f3;
    }

    public void i(float f3) {
        this.f3641j = f3;
    }

    void j(float f3) {
        this.f3637f = f3;
    }

    void k(float f3) {
        this.f3636e = f3;
    }

    public void l(float f3) {
        this.f3638g = f3;
    }

    void m(float f3) {
        this.f3640i = f3;
    }
}
