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
This commit is contained in:
nagachika 2014-07-11 14:08:51 +00:00
parent 068a7dff12
commit feea0a9e82
4 changed files with 15 additions and 6 deletions

View file

@ -146,4 +146,9 @@ class TestVector < Test::Unit::TestCase
v = Vector[Rational(1,2), 0]
assert_equal(0.5, v.norm)
end
def test_cross_product
v = Vector[1, 0, 0].cross_product Vector[0, 1, 0]
assert_equal(Vector[0, 0, 1], v)
end
end