I'm developing an application which measures the accelerometer values to indicate how much the phone is being shaken. At the moment I'm just using the Z value, which works if the phone is lying flat on its back. Is there any formula to combine x + y + z in order to give the value irrespective of the orientation of the phone?

If you mean what I think you mean: If only Z it's Z. X+Z it's: VALxz^2=X^2+Z^2 X+Y+Z it's: VALxyz^2 = VALxz^2 + Y^2 Hope that helps. Cheers.

My answer is somewhat close to what Metter said, but if I understand your question correctly, you want to get the amount of acceleration irrespective of direction. If that is the case, the value you would be looking for is the root of the sum of the squares: absolute value = sqrt(X^2 + Y^2 + Z^2); See The Pythagorean Theorem for details.

What I mean is: "How much is the phone being shaken - whether up and down, or sideways, or diagonally, etc?" DaveInNYC: Thanks, that's what I needed.