package p3; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Path; import android.graphics.RectF; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /* loaded from: classes2.dex */ public class m { /* renamed from: a, reason: collision with root package name */ public float f13207a; /* renamed from: b, reason: collision with root package name */ public float f13208b; /* renamed from: c, reason: collision with root package name */ public float f13209c; /* renamed from: d, reason: collision with root package name */ public float f13210d; /* renamed from: e, reason: collision with root package name */ public float f13211e; /* renamed from: f, reason: collision with root package name */ public float f13212f; /* renamed from: g, reason: collision with root package name */ private final List f13213g = new ArrayList(); /* renamed from: h, reason: collision with root package name */ private final List f13214h = new ArrayList(); class a extends g { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ List f13215b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ Matrix f13216c; a(List list, Matrix matrix) { this.f13215b = list; this.f13216c = matrix; } @Override // p3.m.g public void a(Matrix matrix, o3.a aVar, int i10, Canvas canvas) { Iterator it = this.f13215b.iterator(); while (it.hasNext()) { ((g) it.next()).a(this.f13216c, aVar, i10, canvas); } } } static class b extends g { /* renamed from: b, reason: collision with root package name */ private final d f13218b; public b(d dVar) { this.f13218b = dVar; } @Override // p3.m.g public void a(Matrix matrix, o3.a aVar, int i10, Canvas canvas) { aVar.a(canvas, matrix, new RectF(this.f13218b.k(), this.f13218b.o(), this.f13218b.l(), this.f13218b.j()), i10, this.f13218b.m(), this.f13218b.n()); } } static class c extends g { /* renamed from: b, reason: collision with root package name */ private final e f13219b; /* renamed from: c, reason: collision with root package name */ private final float f13220c; /* renamed from: d, reason: collision with root package name */ private final float f13221d; public c(e eVar, float f10, float f11) { this.f13219b = eVar; this.f13220c = f10; this.f13221d = f11; } @Override // p3.m.g public void a(Matrix matrix, o3.a aVar, int i10, Canvas canvas) { RectF rectF = new RectF(0.0f, 0.0f, (float) Math.hypot(this.f13219b.f13230c - this.f13221d, this.f13219b.f13229b - this.f13220c), 0.0f); Matrix matrix2 = new Matrix(matrix); matrix2.preTranslate(this.f13220c, this.f13221d); matrix2.preRotate(c()); aVar.b(canvas, matrix2, rectF, i10); } float c() { return (float) Math.toDegrees(Math.atan((this.f13219b.f13230c - this.f13221d) / (this.f13219b.f13229b - this.f13220c))); } } public static class d extends f { /* renamed from: h, reason: collision with root package name */ private static final RectF f13222h = new RectF(); /* renamed from: b, reason: collision with root package name */ public float f13223b; /* renamed from: c, reason: collision with root package name */ public float f13224c; /* renamed from: d, reason: collision with root package name */ public float f13225d; /* renamed from: e, reason: collision with root package name */ public float f13226e; /* renamed from: f, reason: collision with root package name */ public float f13227f; /* renamed from: g, reason: collision with root package name */ public float f13228g; public d(float f10, float f11, float f12, float f13) { q(f10); u(f11); r(f12); p(f13); } /* JADX INFO: Access modifiers changed from: private */ public float j() { return this.f13226e; } /* JADX INFO: Access modifiers changed from: private */ public float k() { return this.f13223b; } /* JADX INFO: Access modifiers changed from: private */ public float l() { return this.f13225d; } /* JADX INFO: Access modifiers changed from: private */ public float m() { return this.f13227f; } /* JADX INFO: Access modifiers changed from: private */ public float n() { return this.f13228g; } /* JADX INFO: Access modifiers changed from: private */ public float o() { return this.f13224c; } private void p(float f10) { this.f13226e = f10; } private void q(float f10) { this.f13223b = f10; } private void r(float f10) { this.f13225d = f10; } /* JADX INFO: Access modifiers changed from: private */ public void s(float f10) { this.f13227f = f10; } /* JADX INFO: Access modifiers changed from: private */ public void t(float f10) { this.f13228g = f10; } private void u(float f10) { this.f13224c = f10; } @Override // p3.m.f public void a(Matrix matrix, Path path) { Matrix matrix2 = this.f13231a; matrix.invert(matrix2); path.transform(matrix2); RectF rectF = f13222h; rectF.set(k(), o(), l(), j()); path.arcTo(rectF, m(), n(), false); path.transform(matrix); } } public static class e extends f { /* renamed from: b, reason: collision with root package name */ private float f13229b; /* renamed from: c, reason: collision with root package name */ private float f13230c; @Override // p3.m.f public void a(Matrix matrix, Path path) { Matrix matrix2 = this.f13231a; matrix.invert(matrix2); path.transform(matrix2); path.lineTo(this.f13229b, this.f13230c); path.transform(matrix); } } public static abstract class f { /* renamed from: a, reason: collision with root package name */ protected final Matrix f13231a = new Matrix(); public abstract void a(Matrix matrix, Path path); } static abstract class g { /* renamed from: a, reason: collision with root package name */ static final Matrix f13232a = new Matrix(); g() { } public abstract void a(Matrix matrix, o3.a aVar, int i10, Canvas canvas); public final void b(o3.a aVar, int i10, Canvas canvas) { a(f13232a, aVar, i10, canvas); } } public m() { m(0.0f, 0.0f); } private void b(float f10) { if (f() == f10) { return; } float f11 = ((f10 - f()) + 360.0f) % 360.0f; if (f11 > 180.0f) { return; } d dVar = new d(h(), i(), h(), i()); dVar.s(f()); dVar.t(f11); this.f13214h.add(new b(dVar)); o(f10); } private void c(g gVar, float f10, float f11) { b(f10); this.f13214h.add(gVar); o(f11); } private float f() { return this.f13211e; } private float g() { return this.f13212f; } private void o(float f10) { this.f13211e = f10; } private void p(float f10) { this.f13212f = f10; } private void q(float f10) { this.f13209c = f10; } private void r(float f10) { this.f13210d = f10; } private void s(float f10) { this.f13207a = f10; } private void t(float f10) { this.f13208b = f10; } public void a(float f10, float f11, float f12, float f13, float f14, float f15) { d dVar = new d(f10, f11, f12, f13); dVar.s(f14); dVar.t(f15); this.f13213g.add(dVar); b bVar = new b(dVar); float f16 = f14 + f15; boolean z10 = f15 < 0.0f; if (z10) { f14 = (f14 + 180.0f) % 360.0f; } c(bVar, f14, z10 ? (180.0f + f16) % 360.0f : f16); double d10 = f16; q(((f10 + f12) * 0.5f) + (((f12 - f10) / 2.0f) * ((float) Math.cos(Math.toRadians(d10))))); r(((f11 + f13) * 0.5f) + (((f13 - f11) / 2.0f) * ((float) Math.sin(Math.toRadians(d10))))); } public void d(Matrix matrix, Path path) { int size = this.f13213g.size(); for (int i10 = 0; i10 < size; i10++) { ((f) this.f13213g.get(i10)).a(matrix, path); } } g e(Matrix matrix) { b(g()); return new a(new ArrayList(this.f13214h), matrix); } float h() { return this.f13209c; } float i() { return this.f13210d; } float j() { return this.f13207a; } float k() { return this.f13208b; } public void l(float f10, float f11) { e eVar = new e(); eVar.f13229b = f10; eVar.f13230c = f11; this.f13213g.add(eVar); c cVar = new c(eVar, h(), i()); c(cVar, cVar.c() + 270.0f, cVar.c() + 270.0f); q(f10); r(f11); } public void m(float f10, float f11) { n(f10, f11, 270.0f, 0.0f); } public void n(float f10, float f11, float f12, float f13) { s(f10); t(f11); q(f10); r(f11); o(f12); p((f12 + f13) % 360.0f); this.f13213g.clear(); this.f13214h.clear(); } }