From fdbfa8e36f85eee051fc562f1a8588970257a20f Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 6 Oct 2022 02:48:43 +0200 Subject: Rotating camera with mouse --- src/Math/Trig.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/Math/Trig.hpp (limited to 'src/Math/Trig.hpp') 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 +T radians(T degrees) { + return (degrees * PI) / 180.0f; +} + +template +T degrees(T radians) { + return radians * 180.0f / PI; +} + +} \ No newline at end of file -- cgit 1.4.1