From af03eef4ab3cc41a6148d1f73fef1193f4fc4dcb Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 12 Jan 2017 18:02:46 +0100 Subject: Use qRadiansToDegrees() and qDegreesToRadians() more widely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ää --- tests/manual/galaxy/star.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/manual/galaxy') 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 -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); -- cgit v1.2.3