Module: Point::Array
- Defined in:
- lib/sixarm_ruby_geometry/point/array.rb,
lib/sixarm_ruby_geometry/point/array/d1.rb,
lib/sixarm_ruby_geometry/point/array/d2.rb,
lib/sixarm_ruby_geometry/point/array/d3.rb
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#+(other) ⇒ Object
12 13 14 15 |
# File 'lib/sixarm_ruby_geometry/point/array.rb', line 12 def +(other) raise ::IndexError unless self.size == other.size self.size.times.map{|i| self[i] + other[i] } end |
#-(other) ⇒ Object
17 18 19 20 |
# File 'lib/sixarm_ruby_geometry/point/array.rb', line 17 def -(other) raise ::IndexError unless self.size == other.size self.size.times.map{|i| self[i] - other[i] } end |