diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-05-28 22:50:13 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-05-28 22:50:13 +0200 |
| commit | 438d063ec684c2194563678ace5a625e6fb56517 (patch) | |
| tree | e561277c1546feac29af26e6303106ae729e041c /src/helpers/Vector2D.cpp | |
| parent | 078ba6daa8e2e2d8e25a226d65a418b8a85956b3 (diff) | |
vector: use c++ stdlib math functions instead of cmath
Diffstat (limited to 'src/helpers/Vector2D.cpp')
| -rw-r--r-- | src/helpers/Vector2D.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/helpers/Vector2D.cpp b/src/helpers/Vector2D.cpp index 2baa7353..e93a856f 100644 --- a/src/helpers/Vector2D.cpp +++ b/src/helpers/Vector2D.cpp @@ -1,6 +1,5 @@ #include "Vector2D.hpp" #include <algorithm> -#include <cmath> Vector2D::Vector2D(double xx, double yy) { x = xx; @@ -16,7 +15,7 @@ Vector2D::~Vector2D() {} double Vector2D::normalize() { // get max abs - const auto max = abs(x) > abs(y) ? abs(x) : abs(y); + const auto max = std::abs(x) > std::abs(y) ? std::abs(x) : std::abs(y); x /= max; y /= max; @@ -25,7 +24,7 @@ double Vector2D::normalize() { } Vector2D Vector2D::floor() { - return Vector2D((int)x, (int)y); + return Vector2D(std::floor(x), std::floor(y)); } Vector2D Vector2D::clamp(const Vector2D& min, const Vector2D& max) { |
