The Vector.cross_product function returns the opposite vector of the expected result
The member function of class Vector returns the opposite vector of the expected result. The function calculates the resulting vector as if the cross_product is v X self instead of self X v. Just to be sure I tried running the exact example from the 2.1.0 documentation, where is specified:
Vector[1, 0, 0].cross_product Vector[0, 1, 0] => Vector[0, 0, 1]
The documentation is right, but running the example produces Vector[0, 0, -1].
The fix is just to swap the two arguments of the '-' operator.
The implementation is in matrix.rb line:1764
merge revision(s) r46780: [Backport #9499]
* lib/matrix.rb: Fix sign for cross_product [#9499]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e