Test fix. Alles klappt (hoffentlich)
This commit is contained in:
parent
d06404f865
commit
4ea94f1917
@ -1,7 +1,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "gamematrix.h"
|
#include "gamematrix.cpp"
|
||||||
|
|
||||||
void test_matmul_basic() {
|
void test_matmul_basic() {
|
||||||
std::array<std::array<double,4>,4> A = {{
|
std::array<std::array<double,4>,4> A = {{
|
||||||
@ -18,7 +18,7 @@ void test_matmul_basic() {
|
|||||||
{7, 7, 7, 7}
|
{7, 7, 7, 7}
|
||||||
}};
|
}};
|
||||||
|
|
||||||
auto C = gameMatrix::matmul(A, B);
|
auto C = Matrix3D::gameMatrix::matmul(A, B);
|
||||||
|
|
||||||
assert(C[0][0] == 2);
|
assert(C[0][0] == 2);
|
||||||
assert(C[0][1] == 3);
|
assert(C[0][1] == 3);
|
||||||
@ -29,7 +29,7 @@ void test_matmul_basic() {
|
|||||||
void test_translate_basic() {
|
void test_translate_basic() {
|
||||||
std::array<double, 3> pos = {3, -2, 8};
|
std::array<double, 3> pos = {3, -2, 8};
|
||||||
|
|
||||||
auto T = gameMatrix::translate(pos);
|
auto T = Matrix3D::gameMatrix::translate(pos);
|
||||||
|
|
||||||
assert(T[0][3] == 3);
|
assert(T[0][3] == 3);
|
||||||
assert(T[1][3] == -2);
|
assert(T[1][3] == -2);
|
||||||
@ -37,7 +37,7 @@ void test_translate_basic() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void test_rot3D_basic() {
|
void test_rot3D_basic() {
|
||||||
auto R = gameMatrix::rot3D(90, 'x');
|
auto R = Matrix3D::gameMatrix::rot3D(90, 'x');
|
||||||
// cos(90°) ≈ 0, sin(90°) ≈ 1
|
// cos(90°) ≈ 0, sin(90°) ≈ 1
|
||||||
assert(std::abs(R[1][1]) < 1e-6);
|
assert(std::abs(R[1][1]) < 1e-6);
|
||||||
assert(std::abs(R[1][2] + 1.0) < 1e-6);
|
assert(std::abs(R[1][2] + 1.0) < 1e-6);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user