package i2;

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

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

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

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

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

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

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

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

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

    public u() {
        d(0.0f, 270.0f, 0.0f);
    }

    public final void a(float f6) {
        float f7 = this.f6652d;
        if (f7 == f6) {
            return;
        }
        float f8 = ((f6 - f7) + 360.0f) % 360.0f;
        if (f8 > 180.0f) {
            return;
        }
        float f9 = this.f6650b;
        float f10 = this.f6651c;
        q qVar = new q(f9, f10, f9, f10);
        qVar.f6642f = this.f6652d;
        qVar.f6643g = f8;
        this.f6655g.add(new o(qVar));
        this.f6652d = f6;
    }

    public final void b(Matrix matrix, Path path) {
        ArrayList arrayList = this.f6654f;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            ((s) arrayList.get(i)).a(matrix, path);
        }
    }

    public final void c(float f6, float f7) {
        r rVar = new r();
        rVar.f6644b = f6;
        rVar.f6645c = f7;
        this.f6654f.add(rVar);
        p pVar = new p(rVar, this.f6650b, this.f6651c);
        float fB = pVar.b() + 270.0f;
        float fB2 = pVar.b() + 270.0f;
        a(fB);
        this.f6655g.add(pVar);
        this.f6652d = fB2;
        this.f6650b = f6;
        this.f6651c = f7;
    }

    public final void d(float f6, float f7, float f8) {
        this.f6649a = f6;
        this.f6650b = 0.0f;
        this.f6651c = f6;
        this.f6652d = f7;
        this.f6653e = (f7 + f8) % 360.0f;
        this.f6654f.clear();
        this.f6655g.clear();
    }
}
