inverse method

Creates a PerspectiveTransform that is the inverse of this

Implementation

PerspectiveTransform inverse() {
  final A = _matrix;

  // Compute the adjoint matrix (transposed cofactors matrix)
  return PerspectiveTransform(
    _PerspectiveMatrix([
      [
        A(2, 2) * A(3, 3) - A(2, 3) * A(3, 2),
        A(1, 3) * A(3, 2) - A(1, 2) * A(3, 3),
        A(1, 2) * A(2, 3) - A(1, 3) * A(2, 2),
      ],
      [
        A(3, 1) * A(2, 3) - A(3, 3) * A(2, 1),
        A(1, 1) * A(3, 3) - A(1, 3) * A(3, 1),
        A(1, 3) * A(2, 1) - A(1, 1) * A(2, 3),
      ],
      [
        A(2, 1) * A(3, 2) - A(2, 2) * A(3, 1),
        A(1, 2) * A(3, 1) - A(1, 1) * A(3, 2),
        A(1, 1) * A(2, 2) - A(1, 2) * A(2, 1),
      ],
    ]),
  );

  // transpose
}