summaryrefslogtreecommitdiff
path: root/test/matrix
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-29 02:42:56 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-29 02:42:56 +0000
commitdc38c877792287240f7ee37d6444da9801a21f57 (patch)
tree962ef238acbc752402dbc7543a017d391c1cad2f /test/matrix
parent9419ecc6e9092e0133cfc8c44d87c6d70c6ace28 (diff)
downloadruby-dc38c877792287240f7ee37d6444da9801a21f57.tar.gz
* lib/matrix.rb: Add aliases for Vector#cross & dot
patch by gogo tanaka [#10352] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/matrix')
-rw-r--r--test/matrix/test_vector.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/matrix/test_vector.rb b/test/matrix/test_vector.rb
index fa29496451..4e2bca6ef6 100644
--- a/test/matrix/test_vector.rb
+++ b/test/matrix/test_vector.rb
@@ -131,6 +131,7 @@ class TestVector < Test::Unit::TestCase
def test_inner_product
assert_equal(1+4+9, @v1.inner_product(@v1))
+ assert_equal(1+4+9, @v1.dot(@v1))
end
def test_r
@@ -168,5 +169,7 @@ class TestVector < Test::Unit::TestCase
def test_cross_product
v = Vector[1, 0, 0].cross_product Vector[0, 1, 0]
assert_equal(Vector[0, 0, 1], v)
+ v = Vector[1, 0, 0].cross Vector[0, 1, 0]
+ assert_equal(Vector[0, 0, 1], v)
end
end