summaryrefslogtreecommitdiff
path: root/lib/matrix.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-11 05:19:33 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-11 05:19:33 +0000
commit72d05366066176f73d7199da67036c4f8778595a (patch)
treedc5ecc605e3aed4e188fba95bfadc3fe8cf6a9ae /lib/matrix.rb
parent9412551ee298619d827f892baad58c6a7687f017 (diff)
* lib/matrix.rb: Fix sign for cross_product [#9499]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/matrix.rb')
-rw-r--r--lib/matrix.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 1a7519f..026492b 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -1811,9 +1811,9 @@ class Vector
#
def cross_product(v)
Vector.Raise ErrDimensionMismatch unless size == v.size && v.size == 3
- Vector[ v[1]*@elements[2] - v[2]*@elements[1],
- v[2]*@elements[0] - v[0]*@elements[2],
- v[0]*@elements[1] - v[1]*@elements[0] ]
+ Vector[ v[2]*@elements[1] - v[1]*@elements[2],
+ v[0]*@elements[2] - v[2]*@elements[0],
+ v[1]*@elements[0] - v[0]*@elements[1] ]
end
#