(multiply-matrices m1 m2)
(multiply-matrices size m1 m2)
Given two arguments, multiplies two 3x3 matrices.
If an additional `size` arg is provided, multiples two matrices of that size.
Source
(defn
multiply-matrices
"Given two arguments, multiplies two 3x3 matrices.\n If an additional `size` arg is provided, multiples two matrices of that size."
([m1 m2] ((mul-mat-fn 3) m1 (or m2 (identity-matrix 3))))
([size m1 m2]
(let
[m2 (or m2 (identity-matrix size))]
(case
size
2
((mul-mat-fn 2) m1 m2)
3
((mul-mat-fn 3) m1 m2)
4
((mul-mat-fn 4) m1 m2)
(mul-mat size m1 m2)))))