mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
update stuff
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
// Created by vlad on 10/28/23.
|
||||
//
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <uml/Vector3.h>
|
||||
#include <cmath>
|
||||
#include <uml/angles.h>
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
//
|
||||
// Created by vlad on 11/6/23.
|
||||
//
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include "uml/angles.h"
|
||||
#include <cmath>
|
||||
#include <numbers>
|
||||
|
||||
|
||||
namespace uml::angles
|
||||
{
|
||||
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)
|
||||
{
|
||||
return degrees * static_cast<float>(M_PI) / 180.f;
|
||||
return degrees * std::numbers::pi_v<float> / 180.f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user