diff --git a/source/Vector3.cpp b/source/Vector3.cpp index a27cd0b..4769889 100644 --- a/source/Vector3.cpp +++ b/source/Vector3.cpp @@ -2,8 +2,6 @@ // Created by vlad on 10/28/23. // -#define _USE_MATH_DEFINES - #include #include #include @@ -183,9 +181,9 @@ namespace uml { return { - std::cos(angles::DegToRad(angles.y)) * length, - std::sin(angles::DegToRad(angles.y)) * length, - std::tan(angles::DegToRad(angles.x)) * length, + std::cos(angles::DegToRad(angles.x)) * std::cos(angles::DegToRad(angles.y)) * length, + std::cos(angles::DegToRad(angles.x)) * std::sin(angles::DegToRad(angles.y)) * length, + std::sin(angles::DegToRad(angles.x)) * length, }; } diff --git a/source/angles.cpp b/source/angles.cpp index 6007d1c..0195090 100644 --- a/source/angles.cpp +++ b/source/angles.cpp @@ -1,19 +1,20 @@ // // Created by vlad on 11/6/23. // -#define _USE_MATH_DEFINES + #include "uml/angles.h" -#include +#include + namespace uml::angles { float RadToDeg(float rads) { - return rads * 180.f / static_cast(M_PI); + return rads * 180.f / std::numbers::pi_v; } float DegToRad(float degrees) { - return degrees * static_cast(M_PI) / 180.f; + return degrees * std::numbers::pi_v / 180.f; } }