lib/ruby_on_rays/matrix4x4.rb
# Returns the product of two matrices.
# @param other [Matrix4x4]
# @return [Matrix4x4]
Returns the product of two matrices.
Returns the product of two matrices .
def mul_matrix_matrix(other)
      rm = Matrix4x4.new
      m2 = other.m
      (0...4).each do |row|
        (0...4).each do |col|
          rm[row, col] = @m[4 * row + 0] * m2[0, col] +
                         @m[4 * row + 1] * m2[1, col] +
                         @m[4 * row + 2] * m2[2, col] +
                         @m[4 * row + 3] * m2[3, col]
        end
      end
      rm
    end
def mul_matrix_matrix ( other ) rm = Matrix4x4 . new m2 = other . m ( 0 ... 4 ) . each do | row | ( 0 ... 4 ) . each do | col | rm [ row , col ] = @m [ 4 * row + 0 ] * m2 [ 0 , col ] + @m [ 4 * row + 1 ] * m2 [ 1 , col ] + @m [ 4 * row + 2 ] * m2 [ 2 , col ] + @m [ 4 * row + 3 ] * m2 [ 3 , col ] end end rm end
Returns the product of two matrices.
Returns the product of two matrices .
None
Matrix4x4
other
<not_specific>
<not_specific>
None