In a previous project I visualized the trajectory of a ball which I launched vertically into the air with a real-time position, velocity and acceleration graph. Expanding on this project, I wanted to calculate and visualize a trajectory prediction based on a simple physical model. In this post, I will explain how I fit the model to the measured state of the ball and visualize the predicted trajectory.
Let's start with the physical model of the ball. For simplicity, I am only considering the vertical movement of the ball, simplifying the problem to a one-dimensional one. Also, I only pattern the ball as soon as it leaves my hand and neglect any air resistance. This simply leaves us with a single constant force acting on the ball: gravity.
The force is calculated with the mass of the ball and the gravitational acceleration. gramwhich is approximately 9.8m/s²depending on location and altitude. He…