diff options
Diffstat (limited to 'src/Math/Matrix.hpp')
| -rw-r--r-- | src/Math/Matrix.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Math/Matrix.hpp b/src/Math/Matrix.hpp index d77760a..545b6a5 100644 --- a/src/Math/Matrix.hpp +++ b/src/Math/Matrix.hpp @@ -4,6 +4,7 @@ #include <cstddef> #include <iostream> #include "Rotation.hpp" +#include "Trig.hpp" template <size_t R, size_t C, typename T = float> struct Matrix { @@ -39,8 +40,10 @@ public: } static Matrix<4, 4> rotation(Rotation angles) { - auto c = angles.vector.map([](auto a) { return cos(a); }); - auto s = angles.vector.map([](auto a) { return sin(a); }); + auto radians = angles.vector.map([](auto a) { return Math::radians(a); }); + + auto c = radians.map([](auto a) { return cos(a); }); + auto s = radians.map([](auto a) { return sin(a); }); Matrix<4, 4> rotation_x{ 1.0f, 0.0f, 0.0f, 0.0f, |
