Replace M_PI with std::numbers:pi (#2713)

This commit is contained in:
Bart Louwers
2024-08-13 01:26:49 +02:00
committed by GitHub
parent b42fa344b3
commit d19ab42d0a
22 changed files with 126 additions and 64 deletions

View File

@@ -2,8 +2,11 @@
#include <mbgl/geometry/anchor.hpp>
#include <mbgl/util/math.hpp>
#include <numbers>
#include <queue>
using namespace std::numbers;
namespace mbgl {
struct Corner {
@@ -55,7 +58,7 @@ bool checkMaxAngle(const GeometryCoordinates& line,
double angleDelta = util::angle_to(prev, current) - util::angle_to(current, next);
// restrict angle to -pi..pi range
angleDelta = std::fabs(std::fmod(angleDelta + 3 * M_PI, M_PI * 2) - M_PI);
angleDelta = std::fabs(std::fmod(angleDelta + 3 * pi, pi * 2) - pi);
recentCorners.emplace(anchorDistance, static_cast<float>(angleDelta));
recentAngleDelta += static_cast<float>(angleDelta);