Search code examples
iosxcodeaccelerometercore-motionuiaccelerometer

Gravity reading Vs User acceleration reading of the iphone accelerometer?


Iphone accelerometer provides user acceleration and gravity reading? It's clear from the apple guide the user acceleration means, the acceleration than the phone get's from the user. Then what is the meaning of gravity reading? Anyway they have mention total acceleration is the addition of both! I m confused with gravity reading, Can anyone explain me the theory behind this?

Thank you in advance!


Solution

  • Gravity is an acceleration which is constant an downward. It is indistingishable along its vector from any other constant acceleration. Rotating the phone is going to change the contribution of gravity to each of the acceleration axis proportionate to angle with the ground. Gravity being constant, any change in combined vector length of the three axis should be due to user acceleration.