Matrix4.inverted constructor

Matrix4.inverted(Matrix4 other)

Constructs a matrix that is the inverse of other.

Implementation

factory Matrix4.inverted(Matrix4 other) {
  final Matrix4 r = new Matrix4.zero();
  final double determinant = r.copyInverse(other);
  if (determinant == 0.0) {
    throw new ArgumentError.value(
        other, 'other', 'Matrix cannot be inverted');
  }
  return r;
}