Method: RMath3D::RMtx2#-

Defined in:
lib/rmath3d/rmath3d_plain.rb

#-(arg) ⇒ Object

call-seq: -

mtx1 - mtx2 : Binary minus operator.



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/rmath3d/rmath3d_plain.rb', line 391

def -( arg )
  if ( arg.class != RMtx2 )
    raise TypeError, "RMtx2#-(arg) : Unknown type #{arg.class} given as RMtx2."
    return nil
  end

  result = RMtx2.new
  for row in 0...2 do
    for col in 0...2 do
      result.setElement( row, col, getElement(row,col) - arg.getElement(row,col) )
    end
  end

  return result
end