Class: Vector
- Inherits:
-
Object
- Object
- Vector
- 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 |
#unit ⇒ Object
19 20 21 |
# File 'lib/core/util.rb', line 19 def unit return self / self.r end |