I'm in STI term and I have to pick up a speed and a distance.

And my teacher gave me a mpu6050 sparkfun gyroscope accelerometer. For now I have managed to find ax, ay and az plus the angle between Ax and the center of gravity but I do not know how to proceed. If you have any advice I am interested because I do not have much time left

I don't know the answer but I think it would be a good idea to modify your Original Post and change the title to mention the MPU6050 - perhaps "Help needed with MPU6050"