lib/ray_tracer/matrix.rb
def inverse
      fail unless invertible?

      d = determinant
      self.class.build(row_count) { |j, i| cofactor(i, j) / Rational(d) }
      #                              ^^^^ notice transposed args
    end
# Overrides Matrix.inverse because the native method modifies a frozen Array
Overrides Matrix.inverse because the native method modifies a frozen Array
Overrides Matrix . inverse because the native method modifies a frozen Array
def inverse
      fail unless invertible?
      d = determinant
      self.class.build(row_count) { |j, i| cofactor(i, j) / Rational(d) }
    end
def inverse fail unless invertible? d = determinant self . class . build ( row_count ) { | j , i | cofactor ( i , j ) / Rational ( d ) } end
Overrides Matrix.inverse because the native method modifies a frozen Array
Overrides Matrix . inverse because the native method modifies a frozen Array
#                              ^^^^ notice transposed args