Predicting a Ball Trajectory. Polynomial Slot in Python with NumPy | by Florian Trautweiler | Jan, 2025

Polynomial Slot in Python with NumPy

Ball Monitoring and Trajectory Prediction

In a earlier venture I visualized the trajectory of a ball that I threw vertically into the air with a real-time place, velocity and acceleration plot. Extending upon this venture, I needed to calculate and visualize a trajectory prediction based mostly on a easy physics mannequin. On this publish, I’ll clarify how I match the mannequin to the measured state of the ball and visualize the anticipated trajectory.

Place, Velocity and Acceleration Plots with Prediction

Let’s begin with the physics mannequin for the ball. For simplicity, I’m solely contemplating the vertical motion of the ball, simplifying the issue to a one-dimensional one. Moreover, I’m solely modelling the ball as quickly because it leaves my hand and neglecting any air drag. This merely leaves us with a single fixed pressure performing on the ball: gravity.

Gravitational Pressure performing on the Ball

The pressure is calculated with the mass of the ball and the gravitational acceleration g, which is roughly 9.8m/s², relying on location and altitude. The…