void prependInverse2D(Matrix matrix)

Source

void prependInverse2D(Matrix matrix) {

  var m00 = 0.0 + matrix.d / matrix.det;
  var m10 = 0.0 - matrix.c / matrix.det;
  var m30 = 0.0 - matrix.tx * m00 - matrix.ty * m10;
  var m01 = 0.0 - matrix.b / matrix.det;
  var m11 = 0.0 + matrix.a / matrix.det;
  var m31 = 0.0 - matrix.tx * m01 - matrix.ty * m11;

  var n00 = this.m00;
  var n10 = this.m10;
  var n30 = this.m30;
  var n01 = this.m01;
  var n11 = this.m11;
  var n31 = this.m31;
  var n02 = this.m02;
  var n12 = this.m12;
  var n32 = this.m32;
  var n03 = this.m03;
  var n13 = this.m13;
  var n33 = this.m33;

  _data[00] = m00 * n00 + m01 * n10;
  _data[01] = m10 * n00 + m11 * n10;
  _data[03] = m30 * n00 + m31 * n10 + n30;
  _data[04] = m00 * n01 + m01 * n11;
  _data[05] = m10 * n01 + m11 * n11;
  _data[07] = m30 * n01 + m31 * n11 + n31;
  _data[08] = m00 * n02 + m01 * n12;
  _data[09] = m10 * n02 + m11 * n12;
  _data[11] = m30 * n02 + m31 * n12 + n32;
  _data[12] = m00 * n03 + m01 * n13;
  _data[13] = m10 * n03 + m11 * n13;
  _data[15] = m30 * n03 + m31 * n13 + n33;
}