diff options
Diffstat (limited to 'examples/sensors/accelbubble/accelbubble.qml')
-rw-r--r-- | examples/sensors/accelbubble/accelbubble.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/sensors/accelbubble/accelbubble.qml b/examples/sensors/accelbubble/accelbubble.qml index 8bd036ff..f26179ff 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 { |