summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-08-03 17:02:41 -0400
committerDavid Thompson <dthompson2@worcester.edu>2022-08-03 17:02:41 -0400
commit1813434abab3a996d672616fded3ef8bbcc4635e (patch)
tree6f8dfc4f3c79f0a9ad72f3f06391951b89dc4d7c
parentfb6f27739d8d6aa918762990f0bc11966f17bf74 (diff)
math: matrix: Add matrix4= procedure.
-rw-r--r--chickadee/math/matrix.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chickadee/math/matrix.scm b/chickadee/math/matrix.scm
index 1a1e020..a04972f 100644
--- a/chickadee/math/matrix.scm
+++ b/chickadee/math/matrix.scm
@@ -48,6 +48,7 @@
make-null-matrix4
make-identity-matrix4
matrix4?
+ matrix4=
matrix4-mult!
matrix4*
matrix4-identity!
@@ -418,6 +419,10 @@ column-major format."
da db dc dd)
matrix))
+(define (matrix4= m1 m2)
+ "Return #t if M1 is the same matrix as M2"
+ (equal? (matrix4-bv m1) (matrix4-bv m2)))
+
(define (matrix4-mult! dest a b)
"Multiply matrices A and B, storing the result in DEST."
(let ((m1 (matrix4-bv a))