invert method Null safety

double invert()

Invert the matrix. Returns the determinant.

Implementation

double invert() {
  final det = determinant();
  if (det == 0.0) {
    return 0.0;
  }
  final invDet = 1.0 / det;
  final temp = _m2storage[0];
  _m2storage[0] = _m2storage[3] * invDet;
  _m2storage[1] = -_m2storage[1] * invDet;
  _m2storage[2] = -_m2storage[2] * invDet;
  _m2storage[3] = temp * invDet;
  return det;
}