summaryrefslogtreecommitdiffstats
path: root/examples/charts/openglseries
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-01-12 18:02:46 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2017-06-14 08:21:17 +0000
commit94f565a00cbc8d779251355cdb94704277711da7 (patch)
tree477bc020099d5dc60f1d0f7f5398afbda830e48e /examples/charts/openglseries
parent81d0c42c7e4b781365556e1e8d1c8de1e592ae47 (diff)
Be (somewhat more) consistent about the value of pi
Use M_PI in C++ and Math.PI in JavaScript (including QML). Use qmath.h's value for M_PI where we can't avoid an explicit value. Task-number: QTBUG-58083 Change-Id: I80c81444c1867f8f0c07f192fa68de933f48bbc4 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'examples/charts/openglseries')
-rw-r--r--examples/charts/openglseries/datasource.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/charts/openglseries/datasource.cpp b/examples/charts/openglseries/datasource.cpp
index 3f8ae9a3..291bc722 100644
--- a/examples/charts/openglseries/datasource.cpp
+++ b/examples/charts/openglseries/datasource.cpp
@@ -117,7 +117,7 @@ void DataSource::generateData(int seriesCount, int rowCount, int colCount)
qreal x(0);
qreal y(0);
// data with sin + random component
- y = height + (yMultiplier * qSin(3.14159265358979 / 50 * j)
+ y = height + (yMultiplier * qSin(M_PI / 50 * j)
+ (yMultiplier * (qreal) rand() / (qreal) RAND_MAX));
// 0.000001 added to make values logaxis compatible
x = 0.000001 + 20.0 * (qreal(j) / qreal(colCount)) + (xAdjustment * qreal(i));