lib/ruby_on_rays/matrix4x4.rb
# Returns the inverse of the matrix.
# @return [Matrix4x4]
Returns the inverse of the matrix.
Returns the inverse of the matrix .
def inverse
      det = determinant
      fail "Matrix is singular: #{@m}" if det.abs < 0.0001
      b = Matrix4x4.new([b00, b01, b02, b03,
                         b10, b11, b12, b13,
                         b20, b21, b22, b23,
                         b30, b31, b32, b33])
      b.mul(1.0 / det)
    end
def inverse det = determinant fail "Matrix is singular: #{@m}" if det . abs < 0.0001 b = Matrix4x4 . new ( [ b00 , b01 , b02 , b03 , b10 , b11 , b12 , b13 , b20 , b21 , b22 , b23 , b30 , b31 , b32 , b33 ] ) b . mul ( 1.0 / det ) end
Returns the inverse of the matrix.
Returns the inverse of the matrix .
None
Matrix4x4