Fix the name of the arguments of qAtan2 to match std::atan2
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 31 Aug 2012 09:53:34 +0000 (11:53 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 31 Aug 2012 14:10:25 +0000 (16:10 +0200)
There is no change in functionality, just swapping of the names x and y.
The std::atan2 function uses (y, x) in that order, so we should too.

Task-number: QTBUG-27090
Change-Id: I7d4597a6c6909f574c517033f5d49fe17b7a7ead
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
src/corelib/kernel/qmath.h
src/corelib/kernel/qmath.qdoc

index 309564b..f5aca27 100644 (file)
@@ -145,14 +145,14 @@ inline qreal qAtan(qreal v)
         return atan(v);
 }
 
-inline qreal qAtan2(qreal x, qreal y)
+inline qreal qAtan2(qreal y, qreal x)
 {
 #ifdef QT_USE_MATH_H_FLOATS
     if (sizeof(qreal) == sizeof(float))
-        return atan2f(float(x), float(y));
+        return atan2f(float(y), float(x));
     else
 #endif
-        return atan2(x, y);
+        return atan2(y, x);
 }
 
 inline qreal qSqrt(qreal v)
index cba19a8..0df208d 100644 (file)
 */
 
 /*!
-    \fn qreal qAtan2(qreal x, qreal y)
-    Returns the arctangent of a point specified by the coordinates \a x and \a y.
-    This function will return the angle and its direction.
+    \fn qreal qAtan2(qreal y, qreal x)
+    Returns the arctangent of a point specified by the coordinates \a y and \a x.
+    This function will return the angle (argument) of that point.
 
     \relates <QtCore/qmath.h>
     \sa qAtan()