summaryrefslogtreecommitdiffstats
path: root/src/imports
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/imports
parent9e83318fdbe6047d401dcd829db9c6e887516d11 (diff)
sqrt => qSqrt, atan2 => qAtan2
Change-Id: I2da59daada99184a166967fb0fe45fc5bae7eba1 Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/sensors2/qsensor2tilt.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/imports/sensors2/qsensor2tilt.cpp b/src/imports/sensors2/qsensor2tilt.cpp
index 8c294f9b..8cf4a617 100644
--- a/src/imports/sensors2/qsensor2tilt.cpp
+++ b/src/imports/sensors2/qsensor2tilt.cpp
@@ -41,7 +41,7 @@
#include "qsensor2tilt.h"
#define _USE_MATH_DEFINES
-#include <math.h>
+#include <qmath.h>
#include <QtCore/QDebug>
#include <QtCore/QStringList>
@@ -266,7 +266,7 @@ qreal QSensor2Tilt::xRotation()
*/
inline qreal calcPitch(double Ax, double Ay, double Az)
{
- return (float)-atan2(Ax, sqrt(Ay * Ay + Az * Az));
+ return (float)-qAtan2(Ax, sqrt(Ay * Ay + Az * Az));
}
/*
@@ -277,7 +277,7 @@ inline qreal calcPitch(double Ax, double Ay, double Az)
*/
inline qreal calcRoll(double Ax, double Ay, double Az)
{
- return (float)atan2(Ay, (sqrt(Ax * Ax + Az * Az)));
+ return (float)qAtan2(Ay, (sqrt(Ax * Ax + Az * Az)));
}
/*!
@@ -376,14 +376,14 @@ bool QSensor2Tilt::filter(QAccelerometerReading* reading)
//get angle beteen 0 and 180 or 0 -180
qreal aG = 1 * sin(xrot);
qreal aK = 1 * cos(xrot);
- xrot = atan2(aG, aK);
+ xrot = qAtan2(aG, aK);
if (xrot > M_PI_2)
xrot = M_PI - xrot;
else if (xrot < -M_PI_2)
xrot = -(M_PI + xrot);
aG = 1 * sin(yrot);
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)