package com.google.android.material.shape;

import android.graphics.Matrix;
import android.graphics.Path;
import java.util.ArrayList;

/* JADX INFO: loaded from: classes2.dex */
public final class e0 {

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

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

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

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

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

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final ArrayList f23064g = new ArrayList();

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final ArrayList f23065h = new ArrayList();

    public e0() {
        e(0.0f, 0.0f, 270.0f, 0.0f);
    }

    public final void a(float f10, float f11, float f12, float f13, float f14, float f15) {
        a0 a0Var = new a0(f10, f11, f12, f13);
        a0Var.f23048f = f14;
        a0Var.f23049g = f15;
        this.f23064g.add(a0Var);
        y yVar = new y(a0Var);
        float f16 = f14 + f15;
        boolean z10 = f15 < 0.0f;
        if (z10) {
            f14 = (f14 + 180.0f) % 360.0f;
        }
        float f17 = z10 ? (180.0f + f16) % 360.0f : f16;
        b(f14);
        this.f23065h.add(yVar);
        this.f23062e = f17;
        double d10 = f16;
        this.f23060c = (((f12 - f10) / 2.0f) * ((float) Math.cos(Math.toRadians(d10)))) + ((f10 + f12) * 0.5f);
        this.f23061d = (((f13 - f11) / 2.0f) * ((float) Math.sin(Math.toRadians(d10)))) + ((f11 + f13) * 0.5f);
    }

    public final void b(float f10) {
        float f11 = this.f23062e;
        if (f11 == f10) {
            return;
        }
        float f12 = ((f10 - f11) + 360.0f) % 360.0f;
        if (f12 > 180.0f) {
            return;
        }
        float f13 = this.f23060c;
        float f14 = this.f23061d;
        a0 a0Var = new a0(f13, f14, f13, f14);
        a0Var.f23048f = this.f23062e;
        a0Var.f23049g = f12;
        this.f23065h.add(new y(a0Var));
        this.f23062e = f10;
    }

    public final void c(Matrix matrix, Path path) {
        ArrayList arrayList = this.f23064g;
        int size = arrayList.size();
        for (int i10 = 0; i10 < size; i10++) {
            ((c0) arrayList.get(i10)).a(matrix, path);
        }
    }

    public final void d(float f10, float f11) {
        b0 b0Var = new b0();
        b0Var.f23052b = f10;
        b0Var.f23053c = f11;
        this.f23064g.add(b0Var);
        z zVar = new z(b0Var, this.f23060c, this.f23061d);
        float fB = zVar.b() + 270.0f;
        float fB2 = zVar.b() + 270.0f;
        b(fB);
        this.f23065h.add(zVar);
        this.f23062e = fB2;
        this.f23060c = f10;
        this.f23061d = f11;
    }

    public final void e(float f10, float f11, float f12, float f13) {
        this.f23058a = f10;
        this.f23059b = f11;
        this.f23060c = f10;
        this.f23061d = f11;
        this.f23062e = f12;
        this.f23063f = (f12 + f13) % 360.0f;
        this.f23064g.clear();
        this.f23065h.clear();
    }
}
