diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h index 309564b0f8..f5aca27c38 100644 --- a/src/corelib/kernel/qmath.h +++ b/src/corelib/kernel/qmath.h @@ -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) diff --git a/src/corelib/kernel/qmath.qdoc b/src/corelib/kernel/qmath.qdoc index cba19a803e..0df208dae5 100644 --- a/src/corelib/kernel/qmath.qdoc +++ b/src/corelib/kernel/qmath.qdoc @@ -114,9 +114,9 @@ */ /*! - \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 \sa qAtan()