Add new (more performant) matrix impl and initial work on tests.

This commit is contained in:
Andrey Antukh 2016-02-04 23:03:07 +02:00
parent b484dff945
commit 2e9a5f0a36
2 changed files with 102 additions and 0 deletions

View file

@ -81,5 +81,23 @@
(t/is (= 4 (gpt/quadrant p4)))))
(t/deftest matrix-constructors-test
(let [m (gmt/matrix)]
(t/is (= @m [1 0 0 1 0 0]))
(t/is (gmt/matrix? m)))
(let [m (gmt/matrix 1 1 1 2 2 2)]
(t/is (= @m [1 1 1 2 2 2]))
(t/is (gmt/matrix? m)))
(let [m (gmt/matrix [1 1 1 2 2 2])]
(t/is (= @m [1 1 1 2 2 2]))
(t/is (gmt/matrix? m))))
(t/deftest matrix-rotate-test
(let [m (-> (gmt/matrix)
(gmt/rotate 10))]
(t/is (= @m [0.984807753012208
-0.17364817766693033
0.17364817766693033
0.984807753012208
0 0]))))