add pi_number define (fix windows)

This commit is contained in:
HENRY Benjamin
2021-06-07 16:50:50 +02:00
parent 1081574ba7
commit 5fc43dc15a
+3 -1
View File
@@ -9,6 +9,8 @@
#include <cmath> #include <cmath>
#include "Vector/Vector2.hpp" #include "Vector/Vector2.hpp"
#define PI_NUMBER 3.14159265359
namespace BBM namespace BBM
{ {
//! @brief A Vector2 data type. (templated to allow any kind of vector2) //! @brief A Vector2 data type. (templated to allow any kind of vector2)
@@ -124,7 +126,7 @@ namespace BBM
{ {
float dot = this->x * o.x + this->y * o.y; float dot = this->x * o.x + this->y * o.y;
float det = this->x * o.y - this->y * o.x; float det = this->x * o.y - this->y * o.x;
return (std::atan2(det, dot) * (180.0f / M_PI)); return (std::atan2(det, dot) * (180.0f / PI_NUMBER));
} }
double magnitude() const double magnitude() const