An interactive, animated simulator comparing projectile motion under three different drag models:
- No drag — closed-form parabolic trajectory
- Linear drag — drag force proportional to velocity (closed-form solution)
- Quadratic drag — drag force proportional to velocity squared (solved
numerically with
scipy.integrate.solve_ivp)
All three trajectories are animated together against real elapsed time, so you can see which one lands first, along with live height-vs-time and speed-vs-time plots and a results table (range, max height, time of flight).
All three drag models launched at the same speed and angle (u=20 m/s, θ=45°), animated together in real time. No drag flies farthest and lands last; quadratic drag falls behind first.
- Live animated trajectory, height, and speed plots, synced to a shared clock
- Editable initial conditions: launch speed (
u), launch angle (θ), linear-drag time constant (τ), and quadratic-drag coefficient (k) - Play/Pause control, with the animation holding briefly at the end of each flight before looping
- Dark theme UI
- Optional Numba JIT-acceleration for the quadratic-drag ODE, with automatic fallback to plain Python if Numba isn't installed
- Python 3.9+
- See
requirements.txt
pip install -r requirements.txtpython projectile.pyType new values for u, θ, τ, and k into the text boxes and
click Run to recompute and replay the animation. Click Pause/Play
to freeze or resume it at any point.
With initial conditions:
No drag (closed form):
Linear drag (drag force
Quadratic drag (numerical):
MIT — see LICENSE.
