diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2017-01-12 18:02:46 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2017-06-14 08:21:29 +0000 |
commit | af03eef4ab3cc41a6148d1f73fef1193f4fc4dcb (patch) | |
tree | ccedb2a89986524e00a374f21ffb77b8b37dba38 /tests/manual/galaxy | |
parent | 53fcf914e278ed4395a4873af2b64272c5d7882c (diff) |
Use qRadiansToDegrees() and qDegreesToRadians() more widely
These document what the arithmetic is actually doing; and save us an
ad-hoc use of an approximate value for pi while we're about it.
Task-number: QTBUG-58083
Change-Id: I82c5502af724b33ec598c5a9da76537f93a95eac
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'tests/manual/galaxy')
-rw-r--r-- | tests/manual/galaxy/star.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/manual/galaxy/star.cpp b/tests/manual/galaxy/star.cpp index 1513c93b..ca6b66f0 100644 --- a/tests/manual/galaxy/star.cpp +++ b/tests/manual/galaxy/star.cpp @@ -31,8 +31,6 @@ #include <QtCore/qmath.h> -static const double DEG_TO_RAD = M_PI / 180.0; - Star::Star() : m_theta(0), m_a(0), @@ -49,7 +47,7 @@ const void Star::calcXY() const QVector2D &p = m_center; qreal beta = -m_angle; - qreal alpha = theta * DEG_TO_RAD; + qreal alpha = qDegreesToRadians(theta); // temporaries to save cpu time qreal cosalpha = qCos(alpha); |