From 963521e0040ba228656700100cb48e7dc06ab47d Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 1 Apr 2015 18:43:33 +0200 Subject: [PATCH] Use PI constant from math.h Based on TortoiseSVN rev. #26416. Signed-off-by: Sven Strickroth --- src/Utils/MiscUI/MyGraph.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Utils/MiscUI/MyGraph.cpp b/src/Utils/MiscUI/MyGraph.cpp index 2da194e44..9dda53f26 100644 --- a/src/Utils/MiscUI/MyGraph.cpp +++ b/src/Utils/MiscUI/MyGraph.cpp @@ -5,6 +5,8 @@ #include "BufferDC.h" #include +#define _USE_MATH_DEFINES +#include // for M_PI #include #ifdef _DEBUG @@ -49,7 +51,9 @@ static char THIS_FILE[] = __FILE__; #define LEGEND_DIVISOR 8 // Scale font to graph height. #define Y_AXIS_LABEL_DIVISOR 6 // Scale font to graph height. -const double PI = 3.1415926535897932384626433832795; +#ifndef M_PI +const double M_PI = 3.1415926535897932384626433832795; +#endif ///////////////////////////////////////////////////////////////////////////// // MyGraphSeries @@ -1578,7 +1582,7 @@ CPoint MyGraph::WedgeEndFromDegrees(double degrees, const CPoint& ptCenter, CPoint pt; - double radians = degrees / 360.0 * PI * 2.0; + double radians = degrees / 360.0 * M_PI * 2.0; pt.x = (int) (radius * cos(radians)); pt.x = ptCenter.x - pt.x; -- 2.11.4.GIT