diff --git a/include/omath/angles.h b/include/omath/angles.h index 03eccd3..9e557fd 100644 --- a/include/omath/angles.h +++ b/include/omath/angles.h @@ -3,9 +3,16 @@ // #pragma once +#include namespace omath::angles { - [[nodiscard]] float RadiansToDegrees(float rads); - [[nodiscard]] float DegreesToRadians(float degrees); -} \ No newline at end of file + [[nodiscard]] constexpr float RadiansToDegrees(const float radiands) + { + return radiands * (180.f / std::numbers::pi_v); + } + [[nodiscard]] constexpr float DegreesToRadians(const float degrees) + { + return degrees * (std::numbers::pi_v / 180.f); + } +} diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 7886760..26a3d6a 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,7 +1,6 @@ target_sources(omath PRIVATE Vector3.cpp matrix.cpp - angles.cpp color.cpp Vector4.cpp) diff --git a/source/angles.cpp b/source/angles.cpp deleted file mode 100644 index 3b9b086..0000000 --- a/source/angles.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// -// Created by vlad on 11/6/23. -// - -#include "omath/angles.h" -#include - - -namespace omath::angles -{ - float RadiansToDegrees(const float radiands) - { - return radiands * (180.f / std::numbers::pi_v); - } - - float DegreesToRadians(const float degrees) - { - return degrees * (std::numbers::pi_v / 180.f); - } -}