From 4cd3730fc17e319fa37796d59a3e1bdf95491b83 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 8 Aug 2018 15:43:57 +0200 Subject: 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 Reviewed-by: Simon Hausmann --- examples/sensors/accelbubble/accelbubble.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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 { -- cgit v1.2.3