[FEAT] Matrix add transpose

This commit is contained in:
NADAL Jean-Baptiste
2024-02-02 16:15:28 +01:00
parent 5866f77915
commit 9bf4dd4f7e
3 changed files with 41 additions and 0 deletions

View File

@@ -194,3 +194,25 @@ TEST_CASE("[Matrix] Multiplying the identity matrix by a tuple", "[Matrix]")
REQUIRE((Matrix::identity() * a) == a);
}
/* ------------------------------------------------------------------------- */
TEST_CASE("[Matrix] Transposing a matrix", "[Matrix]")
{
Matrix a = {
{0, 9, 3, 0},
{9, 8, 0, 8},
{1, 8, 5, 3},
{0, 0, 5, 8}
};
Matrix transposed = {
{0, 9, 1, 0},
{9, 8, 8, 0},
{3, 0, 5, 5},
{0, 8, 3, 8}
};
a.transpose();
REQUIRE(a == transposed);
}