How to determine relative position using accelerometer and gyro data
You can integrate acceleration to obtain velocity data, and you can further integrate velocity to get position. Integration is just the process where you just cumulatively add something up. For example, if you get a new acceleration reading every 0.1 second, you assume the acceleration was constant over the last 0.1 second; you then find the change in velocity over that same time interval by adding 0.1 seconds * acceleration to the current velocity estimate, and repeat this every time a new acceleration reading comes in.

This is what's known as 'dead reckoning', and it has some down sides. Most important is that because you basically are just adding up measurements across time, any errors (e.g., noise) in that data also accumulates, so your approximation of where you are, where you're headed, and how fast you're going all degrade over time.