diff --git a/test/testmatrix.cpp b/test/testmatrix.cpp index 9ff8221d..4d19139a 100644 --- a/test/testmatrix.cpp +++ b/test/testmatrix.cpp @@ -406,6 +406,35 @@ void test_matrix3_transform() } } +void test_matrix3_transposedtransform() +{ + std::printf("testing matrix3 transposedtransform\n"); + { + matrix3 m; + m.identity(); + vec v(1,0,0); + assert(m.transposedtransform(v) == vec(1,0,0)); + } + { + matrix3 m; + m.identity(); + vec v(1,2,3); + assert(m.transposedtransform(v) == vec(1,2,3)); + } + { + matrix3 m({0,1,0}, {1,0,0}, {0,0,1}); + m.identity(); + vec v(1,0,0); + assert(m.transposedtransform(v) == vec(1,0,0)); + } + { + matrix3 m({0,1,0}, {1,0,0}, {0,0,0}); + m.identity(); + vec v(0,0,1); + assert(m.transposedtransform(v) == vec(0,0,1)); + } +} + void test_matrix3_identity() { std::printf("testing matrix3 identity\n"); @@ -1379,6 +1408,7 @@ testing matrices\n\ test_matrix3_trace(); test_matrix3_calcangleaxis(); test_matrix3_transform(); + test_matrix3_transposedtransform(); test_matrix3_identity(); test_matrix3_transpose(); test_matrix3_invert();