Class: Mir::Vect
- Inherits:
-
Struct
- Object
- Struct
- Mir::Vect
- Defined in:
- lib/mir/01_model.rb
Overview
not used systematically…
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x
5 6 7 |
# File 'lib/mir/01_model.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y
5 6 7 |
# File 'lib/mir/01_model.rb', line 5 def y @y end |
Instance Method Details
#+(v) ⇒ Object
6 7 8 |
# File 'lib/mir/01_model.rb', line 6 def +(v) Vect.new y+v.y,x+v.x end |
#scale(fact) ⇒ Object
10 11 12 |
# File 'lib/mir/01_model.rb', line 10 def scale fact Vect.new y*fact,x*fact end |