Given that the phone starts in a staionary position, it would be possible to work out the motion path of where the phone travels. (Just integrate acceleration twice numerically to get a distance vs time graph).
How accurate would this path be? Would shaking the phone mess up the accuracy? Would the gyroscope on some devices help or improve this in any way?
If it is possible to produce a reasonable result, how would I go about starting this – or even better, is there any open source code that does this already?
My personal experience testing this didn’t pan out so well…
The second integral drifts fast enough that the position is meaningless within seconds, and that’s just for linear motion. Shake or twist the phone and it goes out of whack almost immediately. The gyroscope doesn’t help much with this, either.
The results were so bad that I didn’t spend very long investigating. Perhaps others have had more success.