Class: Mir::Vect

Inherits:
Struct
  • Object
show all
Defined in:
lib/mir/01_model.rb

Overview

not used systematically…

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#xObject

Returns the value of attribute x

Returns:

  • (Object)

    the current value of x



5
6
7
# File 'lib/mir/01_model.rb', line 5

def x
  @x
end

#yObject

Returns the value of attribute y

Returns:

  • (Object)

    the current value of 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