Class: Triangular::Vector
Instance Attribute Summary
Attributes inherited from Point
Instance Method Summary collapse
Methods inherited from Point
#==, #initialize, parse, pattern, #to_s, #translate!
Constructor Details
This class inherits a constructor from Triangular::Point
Instance Method Details
#angle_to(other_vector) ⇒ Object
5 6 7 8 9 |
# File 'lib/triangular/vector.rb', line 5 def angle_to(other_vector) dot_product = @x * other_vector.x + @y * other_vector.y + @z * other_vector.z radians = Math.acos(dot_product) radians * (180.0 / Math::PI) end |