/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

package com.pullenti.unitext.internal.pdf;

public class Matrix {

    public double A;

    public double B;

    public double C;

    public double D;

    public double E;

    public double F;

    public Matrix() {
        this.init();
    }

    public void set(double a, double b, double c, double d, double e, double f) {
        A = a;
        B = b;
        C = c;
        D = d;
        E = e;
        F = f;
    }

    @Override
    public String toString() {
        return ("[" + A + " " + B + " " + C + " " + D + " " + E + " " + F + "]");
    }

    public void init() {
        A = 1.0;
        B = 0.0;
        C = 0.0;
        D = 1.0;
        E = 0.0;
        F = 0.0;
    }

    public void copyFrom(Matrix m) {
        A = m.A;
        B = m.B;
        C = m.C;
        D = m.D;
        E = m.E;
        F = m.F;
    }

    public void multiply(Matrix m) {
        double a = (A * m.A) + (B * m.C);
        double b = (A * m.B) + (B * m.D);
        double c = (C * m.A) + (D * m.C);
        double d = (C * m.B) + (D * m.D);
        double e = (E * m.A) + (F * m.C) + m.E;
        double f = (E * m.B) + (F * m.D) + m.F;
        this.set(a, b, c, d, e, f);
    }

    public void translate(double e, double f) {
        E = (A * e) + (C * f) + E;
        F = (B * e) + (D * f) + F;
    }
}
