summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-08-08 15:43:57 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-08-22 11:30:53 +0000
commit4cd3730fc17e319fa37796d59a3e1bdf95491b83 (patch)
tree5b1dd1483fefd9beb951b4ebca20a7610d9dbdad
parent44c357ce531b06d7050ac9987c1ee8c1c470bd75 (diff)
Revert "Don't try to call Math.hypot() until V4 implements it"
This reverts commit dce96572f6e073cdf8eed916365c2cc81e9da4a4, thereby restoring use of Math.hypot(), now that V4 supports it. Change-Id: I27fed3fff8cf2863257a15e906e55ab907b70078 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--examples/sensors/accelbubble/accelbubble.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/sensors/accelbubble/accelbubble.qml b/examples/sensors/accelbubble/accelbubble.qml
index f26179ff..8bd036ff 100644
--- a/examples/sensors/accelbubble/accelbubble.qml
+++ b/examples/sensors/accelbubble/accelbubble.qml
@@ -101,10 +101,10 @@ ApplicationWindow {
}
function calcPitch(x,y,z) {
- return -Math.atan2(y, Math.sqrt(x * x + z * z)) * mainWindow.radians_to_degrees;
+ return -Math.atan2(y, Math.hypot(x, z)) * mainWindow.radians_to_degrees;
}
function calcRoll(x,y,z) {
- return -Math.atan2(x, Math.sqrt(y * y + z * z)) * mainWindow.radians_to_degrees;
+ return -Math.atan2(x, Math.hypot(y, z)) * mainWindow.radians_to_degrees;
}
Image {