From dce96572f6e073cdf8eed916365c2cc81e9da4a4 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 23 May 2018 15:20:16 +0200 Subject: Don't try to call Math.hypot() until V4 implements it We'll be adding that in dev (where I'll then revert this) but I was mistaken when I simply assumed V4 had it while updating this example before. Task-number: QTBUG-68277 Change-Id: Idb3b45317bfb410cea12c3795e82670db79c18b5 Reviewed-by: Allan Sandfeld Jensen --- 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 8bd036f..f26179f 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.hypot(x, z)) * mainWindow.radians_to_degrees; + return -Math.atan2(y, Math.sqrt(x * x + z * z)) * mainWindow.radians_to_degrees; } function calcRoll(x,y,z) { - return -Math.atan2(x, Math.hypot(y, z)) * mainWindow.radians_to_degrees; + return -Math.atan2(x, Math.sqrt(y * y + z * z)) * mainWindow.radians_to_degrees; } Image { -- cgit v1.2.1