summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensorgestures/qtsensors
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@nokia.com>2012-02-16 09:27:40 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-20 06:39:39 +0100
commit436ac0b3890ac7ec0dd5cc9ca9f7a099d5e8a813 (patch)
tree7fe6835111c13269b10a5157cf0c5e2ab66f5ee6 /src/plugins/sensorgestures/qtsensors
parent9e83318fdbe6047d401dcd829db9c6e887516d11 (diff)
sqrt => qSqrt, atan2 => qAtan2
Change-Id: I2da59daada99184a166967fb0fe45fc5bae7eba1 Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'src/plugins/sensorgestures/qtsensors')
-rw-r--r--src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.cpp6
-rw-r--r--src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp6
-rw-r--r--src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.cpp b/src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.cpp
index 6724190b..e90f52db 100644
--- a/src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.cpp
+++ b/src/plugins/sensorgestures/qtsensors/qpickupsensorgesturerecognizer.cpp
@@ -54,11 +54,11 @@ QT_BEGIN_NAMESPACE
inline qreal calcPitch(double Ax, double Ay, double Az)
{
- return (float)-atan2(Ax, sqrt(Ay * Ay + Az * Az));
+ return (float)-qAtan2(Ax, qSqrt(Ay * Ay + Az * Az));
}
inline qreal calcRoll(double Ax, double Ay, double Az)
{
- return (float)atan2(Ay, (sqrt(Ax * Ax + Az * Az)));
+ return (float)qAtan2(Ay, (qSqrt(Ax * Ax + Az * Az)));
}
QPickupSensorGestureRecognizer::QPickupSensorGestureRecognizer(QObject *parent) :
@@ -176,7 +176,7 @@ qreal QPickupSensorGestureRecognizer::calc(qreal yrot)
qreal aG = 1 * sin(yrot);
qreal aK = 1 * cos(yrot);
- yrot = atan2(aG, aK);
+ yrot = qAtan2(aG, aK);
if (yrot > M_PI_2)
yrot = M_PI - yrot;
else if (yrot < -M_PI_2)
diff --git a/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp b/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp
index ced3a4ec..df99f21a 100644
--- a/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp
+++ b/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp
@@ -56,12 +56,12 @@ QT_BEGIN_NAMESPACE
// from qsensor2tilt
inline qreal calcPitch(double Ax, double Ay, double Az)
{
- return (float)-atan2(Ax, sqrt(Ay * Ay + Az * Az));
+ return (float)-qAtan2(Ax, qSqrt(Ay * Ay + Az * Az));
}
inline qreal calcRoll(double Ax, double Ay, double Az)
{
- return (float)atan2(Ay, (sqrt(Ax * Ax + Az * Az)));
+ return (float)qAtan2(Ay, (qSqrt(Ax * Ax + Az * Az)));
}
QTwistSensorGestureRecognizer::QTwistSensorGestureRecognizer(QObject *parent) :
@@ -204,7 +204,7 @@ qreal QTwistSensorGestureRecognizer::calc(qreal yrot)
qreal aG = 1 * sin(yrot);
qreal aK = 1 * cos(yrot);
- yrot = atan2(aG, aK);
+ yrot = qAtan2(aG, aK);
if (yrot > M_PI_2)
yrot = M_PI - yrot;
else if (yrot < -M_PI_2)
diff --git a/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp b/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp
index e6ebe191..93e147ad 100644
--- a/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp
+++ b/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
inline qreal calcYaw(double Ax, double Ay, double Az)
{
- return (float)atan2(Az, (sqrt(Ax * Ax + Ay * Ay)));
+ return (float)qAtan2(Az, (qSqrt(Ax * Ax + Ay * Ay)));
}
QWhipSensorGestureRecognizer::QWhipSensorGestureRecognizer(QObject *parent) :
@@ -170,7 +170,7 @@ qreal QWhipSensorGestureRecognizer::calc(qreal yrot)
qreal aG = 1 * sin(yrot);
qreal aK = 1 * cos(yrot);
- yrot = atan2(aG, aK);
+ yrot = qAtan2(aG, aK);
if (yrot > M_PI_2)
yrot = M_PI - yrot;
else if (yrot < -M_PI_2)