package fl;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;

/* loaded from: classes3.dex */
public final class k {

    /* renamed from: a, reason: collision with root package name */
    private final float f18574a;

    /* renamed from: b, reason: collision with root package name */
    private final float f18575b;

    /* renamed from: c, reason: collision with root package name */
    private final float f18576c;

    /* renamed from: d, reason: collision with root package name */
    private final float f18577d;

    /* renamed from: e, reason: collision with root package name */
    private final float f18578e;

    /* renamed from: f, reason: collision with root package name */
    private final float f18579f;

    /* renamed from: g, reason: collision with root package name */
    private final float f18580g;

    /* renamed from: h, reason: collision with root package name */
    private final float f18581h;

    /* renamed from: i, reason: collision with root package name */
    private final float f18582i;

    private k(float f10, float f11, float f12, float f13, float f14, float f15, float f16, float f17, float f18) {
        this.f18574a = f10;
        this.f18575b = f13;
        this.f18576c = f16;
        this.f18577d = f11;
        this.f18578e = f14;
        this.f18579f = f17;
        this.f18580g = f12;
        this.f18581h = f15;
        this.f18582i = f18;
    }

    public static k b(float f10, float f11, float f12, float f13, float f14, float f15, float f16, float f17, float f18, float f19, float f20, float f21, float f22, float f23, float f24, float f25) {
        return d(f18, f19, f20, f21, f22, f23, f24, f25).e(c(f10, f11, f12, f13, f14, f15, f16, f17));
    }

    public static k c(float f10, float f11, float f12, float f13, float f14, float f15, float f16, float f17) {
        return d(f10, f11, f12, f13, f14, f15, f16, f17).a();
    }

    public static k d(float f10, float f11, float f12, float f13, float f14, float f15, float f16, float f17) {
        float f18 = ((f10 - f12) + f14) - f16;
        float f19 = ((f11 - f13) + f15) - f17;
        if (f18 == BitmapDescriptorFactory.HUE_RED && f19 == BitmapDescriptorFactory.HUE_RED) {
            return new k(f12 - f10, f14 - f12, f10, f13 - f11, f15 - f13, f11, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 1.0f);
        }
        float f20 = f12 - f14;
        float f21 = f16 - f14;
        float f22 = f13 - f15;
        float f23 = f17 - f15;
        float f24 = (f20 * f23) - (f21 * f22);
        float f25 = ((f23 * f18) - (f21 * f19)) / f24;
        float f26 = ((f20 * f19) - (f18 * f22)) / f24;
        return new k((f25 * f12) + (f12 - f10), (f26 * f16) + (f16 - f10), f10, (f13 - f11) + (f25 * f13), (f17 - f11) + (f26 * f17), f11, f25, f26, 1.0f);
    }

    k a() {
        float f10 = this.f18578e;
        float f11 = this.f18582i;
        float f12 = this.f18579f;
        float f13 = this.f18581h;
        float f14 = (f10 * f11) - (f12 * f13);
        float f15 = this.f18580g;
        float f16 = this.f18577d;
        float f17 = (f12 * f15) - (f16 * f11);
        float f18 = (f16 * f13) - (f10 * f15);
        float f19 = this.f18576c;
        float f20 = this.f18575b;
        float f21 = this.f18574a;
        return new k(f14, f17, f18, (f19 * f13) - (f20 * f11), (f11 * f21) - (f19 * f15), (f15 * f20) - (f13 * f21), (f20 * f12) - (f19 * f10), (f19 * f16) - (f12 * f21), (f21 * f10) - (f20 * f16));
    }

    k e(k kVar) {
        float f10 = this.f18574a;
        float f11 = kVar.f18574a;
        float f12 = this.f18577d;
        float f13 = kVar.f18575b;
        float f14 = this.f18580g;
        float f15 = kVar.f18576c;
        float f16 = (f10 * f11) + (f12 * f13) + (f14 * f15);
        float f17 = kVar.f18577d;
        float f18 = kVar.f18578e;
        float f19 = kVar.f18579f;
        float f20 = (f10 * f17) + (f12 * f18) + (f14 * f19);
        float f21 = kVar.f18580g;
        float f22 = kVar.f18581h;
        float f23 = kVar.f18582i;
        float f24 = (f10 * f21) + (f12 * f22) + (f14 * f23);
        float f25 = this.f18575b;
        float f26 = this.f18578e;
        float f27 = this.f18581h;
        float f28 = (f25 * f11) + (f26 * f13) + (f27 * f15);
        float f29 = (f25 * f17) + (f26 * f18) + (f27 * f19);
        float f30 = (f27 * f23) + (f25 * f21) + (f26 * f22);
        float f31 = this.f18576c;
        float f32 = this.f18579f;
        float f33 = this.f18582i;
        return new k(f16, f20, f24, f28, f29, f30, (f15 * f33) + (f11 * f31) + (f13 * f32), (f17 * f31) + (f18 * f32) + (f19 * f33), (f31 * f21) + (f32 * f22) + (f33 * f23));
    }

    public void f(float[] fArr) {
        float f10 = this.f18574a;
        float f11 = this.f18575b;
        float f12 = this.f18576c;
        float f13 = this.f18577d;
        float f14 = this.f18578e;
        float f15 = this.f18579f;
        float f16 = this.f18580g;
        float f17 = this.f18581h;
        float f18 = this.f18582i;
        int length = fArr.length - 1;
        for (int i10 = 0; i10 < length; i10 += 2) {
            float f19 = fArr[i10];
            int i11 = i10 + 1;
            float f20 = fArr[i11];
            float f21 = (f12 * f19) + (f15 * f20) + f18;
            fArr[i10] = (((f10 * f19) + (f13 * f20)) + f16) / f21;
            fArr[i11] = (((f19 * f11) + (f20 * f14)) + f17) / f21;
        }
    }
}
