Possible Duplicate:
Need to find Distance using Gyro+Accelerometer
Android accelerometer accuracy (Inertial navigation)
I am developing an iOS app that measures the distance moved, for example, one could keep the iPhone in one's pocket after turning on the app, then should be able to get the distance he traveled by a vehicle that he is in, or if he is walking, running etc.I want it to be accurate enough so that one could move a device placed on a table, by say a feet, and the app tells you this small distance moved even. I do not want to use the GPS, but only the gyroscope and the accelerometer. What I have thought so far, is to get the angles by which the device has rotated along its three axes from the gyroscope and accelerometer data, periodically, and then use this info to figure out the magnitude of movement along the axis in which the user is moving, using the accelerometer. Does this look like a working approach? Also, are the in-built gyroscope and accelerometer accurate enough for this?