Method: RMath3D::RMtx2#mul!
- Defined in:
- lib/rmath3d/rmath3d_plain.rb
#mul!(other) ⇒ Object
call-seq: mtx1.mul!( mtx2 )
mtx1 *= mtx2
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 |
# File 'lib/rmath3d/rmath3d_plain.rb', line 504 def mul!( other ) case other when Fixnum, Float, Bignum self.e00 = other*self.e00 self.e01 = other*self.e01 self.e10 = other*self.e10 self.e11 = other*self.e11 return self when RMtx2 result = RMtx2.new for row in 0...2 do for col in 0...2 do sum = 0.0 for i in 0...2 do sum += getElement( row, i ) * other.getElement( i, col ) end result.setElement( row, col, sum ) end end self.e00 = result.e00 self.e01 = result.e01 self.e10 = result.e10 self.e11 = result.e11 return self end end |