update stuff

This commit is contained in:
2024-05-07 02:12:17 +03:00
parent 526e4de812
commit 503114e4b8
2 changed files with 8 additions and 9 deletions

View File

@@ -2,8 +2,6 @@
// Created by vlad on 10/28/23. // Created by vlad on 10/28/23.
// //
#define _USE_MATH_DEFINES
#include <uml/Vector3.h> #include <uml/Vector3.h>
#include <cmath> #include <cmath>
#include <uml/angles.h> #include <uml/angles.h>
@@ -183,9 +181,9 @@ namespace uml
{ {
return return
{ {
std::cos(angles::DegToRad(angles.y)) * length, std::cos(angles::DegToRad(angles.x)) * std::cos(angles::DegToRad(angles.y)) * length,
std::sin(angles::DegToRad(angles.y)) * length, std::cos(angles::DegToRad(angles.x)) * std::sin(angles::DegToRad(angles.y)) * length,
std::tan(angles::DegToRad(angles.x)) * length, std::sin(angles::DegToRad(angles.x)) * length,
}; };
} }

View File

@@ -1,19 +1,20 @@
// //
// Created by vlad on 11/6/23. // Created by vlad on 11/6/23.
// //
#define _USE_MATH_DEFINES
#include "uml/angles.h" #include "uml/angles.h"
#include <cmath> #include <numbers>
namespace uml::angles namespace uml::angles
{ {
float RadToDeg(float rads) float RadToDeg(float rads)
{ {
return rads * 180.f / static_cast<float>(M_PI); return rads * 180.f / std::numbers::pi_v<float>;
} }
float DegToRad(float degrees) float DegToRad(float degrees)
{ {
return degrees * static_cast<float>(M_PI) / 180.f; return degrees * std::numbers::pi_v<float> / 180.f;
} }
} }