Making Physics / Mechanics / Projectile Motion
Chapter 01

Projectile Motion

How does a body move under constant gravity — and how much does the computer's timestep change the answer?

Interactive · live simulation

Adjust launch speed, angle, and drag — the arc is integrated live with RK4 while a marker flies the trajectory.

Projectile Motion — simulation render
fig 1. Ideal vs. drag trajectories. The no-drag arc is the analytic parabola; quadratic drag pulls the range in and tilts the descent steeper than the rise.

The model

The state is a position and a velocity; the only acceleration is (0,\,-g). With no drag the total mechanical energy KE + mgh should be exactly constant, so it becomes the first diagnostic: if the number drifts, the integrator — not the physics — is responsible.

Total mechanical energy. Flat with no drag (a conservation check on the integrat
fig 2. Total mechanical energy. Flat with no drag (a conservation check on the integrator); monotonically falling once drag starts removing energy from the motion.

Euler is not free

Run the same launch with explicit Euler, semi-implicit (symplectic) Euler, and RK4 at timesteps of 1/10, 1/30, and 1/120 s. Explicit Euler injects energy and overshoots the analytic arc; semi-implicit Euler stays bounded; RK4 tracks the closed form x(t) = x_0 + v_0 t + \tfrac12 a t^2 to the width of the line. This is the project's recurring theme in miniature — match the integrator to the structure you care about.

Adding drag

Quadratic drag F = -c\,|v|\,v turns the symmetric parabola into a shorter, steeper-falling arc and makes the energy plot tip downward. There is no longer a closed form, so the simulation stops being a check and starts being the only answer.

This chapter is drawn from the physics-lab study notes and renders. The longer write-ups and project essays live on the blog.

Read more on the blog →