diff options
| author | Mel <einebeere@gmail.com> | 2022-10-06 02:48:43 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-10-06 02:48:43 +0200 |
| commit | fdbfa8e36f85eee051fc562f1a8588970257a20f (patch) | |
| tree | e861a56c50b1e8532bd71a21064d76d0c148ed3a /src/Math/Trig.hpp | |
| parent | 731846a0c654b39e23c26f611470e401df404c9d (diff) | |
| download | meowcraft-fdbfa8e36f85eee051fc562f1a8588970257a20f.tar.zst meowcraft-fdbfa8e36f85eee051fc562f1a8588970257a20f.zip | |
Rotating camera with mouse
Diffstat (limited to 'src/Math/Trig.hpp')
| -rw-r--r-- | src/Math/Trig.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Math/Trig.hpp b/src/Math/Trig.hpp new file mode 100644 index 0000000..c64e2f2 --- /dev/null +++ b/src/Math/Trig.hpp @@ -0,0 +1,17 @@ +#pragma once + +namespace Math { + +constexpr double PI = 3.14159265358979323846; + +template<typename T> +T radians(T degrees) { + return (degrees * PI) / 180.0f; +} + +template<typename T> +T degrees(T radians) { + return radians * 180.0f / PI; +} + +} \ No newline at end of file |
