Using acceleration to plot position Sorry if this question is dumb, and I know is physics 101, but I'm not that good with physics.
I'm writing an iPhone program that by collecting the acceleration data of the device tries to replicate the motion of the device in an virtual environment.
To simplify things, let's consider just one axis.
If the device is at position 0 with acceleration 0 and speed 0, if it receives an acceleration of 1.25G, what it will be it's position after 1.22 seconds, considering that the acceleration will last for the whole 1.22 seconds?
 A: We are looking for the position, say $s$, of the object at a certain time $t$. Given initial conditions $t_0$ (initial time), $v_0$ (velocity at $t_0$), $s_0$ (position at $t_0$) and a constant acceleration $a$ during a time interval $t - t_0$.
We use the following equation to determine the position $s$ at time $t$:
$$s = s_0 + v_0(t-t0) + \frac {1}{2}a(t-t_0)^2$$
(This page would be helpful if you need more.)
Hope this helps!
A: The existing answers are fine if the accelerations are constant enough. If you collect the data with the accelerometer of the device, there's a very good chance that the accelerations you're dealing with is not constant.
There are some numerical integration methods (Euler, Verlet, Runge-Kutta, ...) to integrate the accelerations of moving bodies, so we can know its position as a function of time. You can do a bit of research on Wikipedia, pick one that you understand (I don't recommend Euler however). Still, the methods (especially the second-order ones) are often based on the fact that the equation $ s = s_0 + v_0 t + \frac12 gt^2 $ holds approximately true for small intervals of time.
