summary refs log tree commit diff
path: root/src/Math/Trig.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Math/Trig.hpp')
-rw-r--r--src/Math/Trig.hpp17
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