From 679a660e21f3827b99095cce85cd6711d65e51e5 Mon Sep 17 00:00:00 2001 From: Alex Foster <123afoster@gmail.com> Date: Mon, 4 Nov 2024 23:43:50 -0800 Subject: [PATCH] test matrix3::multranspose --- test/testmatrix.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/testmatrix.cpp b/test/testmatrix.cpp index bb4f4c18..aef92aa5 100644 --- a/test/testmatrix.cpp +++ b/test/testmatrix.cpp @@ -152,6 +152,33 @@ void test_matrix3_mul() } } +void test_matrix3_multranspose() +{ + std::printf("testing matrix3 multranspose\n"); + //multranspose(const matrix3&); + { + matrix3 a,b; + a.identity(); + b.identity(); + a.multranspose(b); + assert(a.a == vec(1,0,0)); + assert(a.b == vec(0,1,0)); + assert(a.c == vec(0,0,1)); + } + { + matrix3 a; + vec e1(1,2,3), + e2(4,5,6), + e3(7,8,9); + matrix3 b(e1,e2,e3); + a.identity(); + a.multranspose(b); + assert(a.a == vec(1,4,7)); + assert(a.b == vec(2,1,8)); + assert(a.c == vec(3,6,9)); + } +} + void test_matrix3_normalize() { std::printf("testing matrix3 normalize\n"); @@ -1288,6 +1315,7 @@ testing matrices\n\ test_matrix3_ctor(); test_matrix3_mul(); + test_matrix3_multranspose(); test_matrix3_normalize(); test_matrix3_scale(); test_matrix3_setyaw();