From cd16053c2befc632d52141ece580bbd5ff70ec9a Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sun, 2 Aug 2026 18:53:06 +0200 Subject: [PATCH] rugnux: use the project PI constant, not M_PI MSVC does not define M_PI without _USE_MATH_DEFINES, and rugnux is part of the portable subset that JFJOCH_VIEWER_ONLY builds. JFJochMath.h already carries PI for exactly this reason. Co-Authored-By: Claude Opus 5 (1M context) --- rugnux/Rugnux.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rugnux/Rugnux.cpp b/rugnux/Rugnux.cpp index afae34ac..5ef45192 100644 --- a/rugnux/Rugnux.cpp +++ b/rugnux/Rugnux.cpp @@ -16,6 +16,7 @@ #include #include "../reader/JFJochHDF5Reader.h" +#include "../common/JFJochMath.h" #include "../common/Logger.h" #include "../common/AzimuthalIntegrationMapping.h" #include "../common/AzimuthalIntegrationProfile.h" @@ -400,7 +401,7 @@ namespace { if (len < 1e-6 * lattice.Vec0().Length()) continue; const double cosang = std::abs((axis * spindle) / (len * spindle_len)); - const double ang = std::acos(std::min(1.0, cosang)) * 180.0 / M_PI; + const double ang = std::acos(std::min(1.0, cosang)) * 180.0 / PI; if (!best.has_value() || ang < best->first) best = std::make_pair(ang, order); break;