Class: Vector

Inherits:
Object
  • Object
show all
Defined in:
lib/core/util.rb

Instance Method Summary collapse

Instance Method Details

#angle(other) ⇒ Object



23
24
25
# File 'lib/core/util.rb', line 23

def angle(other)
  return Math.acos(self.inner_product other / (self.r * other.r))
end

#unitObject



19
20
21
# File 'lib/core/util.rb', line 19

def unit
  return self / self.r
end