Method: RMath3D::RMtx2#+
- Defined in:
- lib/rmath3d/rmath3d_plain.rb
#+(arg) ⇒ Object
call-seq: +
mtx1 + mtx2 : Binary plus operator.
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/rmath3d/rmath3d_plain.rb', line 370 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 |