/*
 * 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
 */


class Matrix {
    
    constructor() {
        this.A = 0;
        this.B = 0;
        this.C = 0;
        this.D = 0;
        this.E = 0;
        this.F = 0;
        this.init();
    }
    
    set(a, b, c, d, e, f) {
        this.A = a;
        this.B = b;
        this.C = c;
        this.D = d;
        this.E = e;
        this.F = f;
    }
    
    toString() {
        return ("[" + this.A + " " + this.B + " " + this.C + " " + this.D + " " + this.E + " " + this.F + "]");
    }
    
    init() {
        this.A = 1;
        this.B = 0;
        this.C = 0;
        this.D = 1;
        this.E = 0;
        this.F = 0;
    }
    
    copyFrom(m) {
        this.A = m.A;
        this.B = m.B;
        this.C = m.C;
        this.D = m.D;
        this.E = m.E;
        this.F = m.F;
    }
    
    multiply(m) {
        let a = (this.A * m.A) + (this.B * m.C);
        let b = (this.A * m.B) + (this.B * m.D);
        let c = (this.C * m.A) + (this.D * m.C);
        let d = (this.C * m.B) + (this.D * m.D);
        let e = (this.E * m.A) + (this.F * m.C) + m.E;
        let f = (this.E * m.B) + (this.F * m.D) + m.F;
        this.set(a, b, c, d, e, f);
    }
    
    translate(e, f) {
        this.E = (this.A * e) + (this.C * f) + this.E;
        this.F = (this.B * e) + (this.D * f) + this.F;
    }
}


module.exports = Matrix