🏃 Projectile Motion — Optimal Launch Angle
Fire a cannonball and watch the parabolic arc in real time. Toggle air resistance, compare trajectories at 15°–75°, and discover why 45° maximises range on a flat field. Switch gravity between Moon, Earth, and Jupiter.
Launch Parameters
Gravity
Air Resistance
Overlays
Stats
Keyboard
R Reset
Physics of Projectile Motion
Ignoring air resistance, horizontal and vertical motion are independent.
The equations are:
x = v₀ cosθ · t |
y = v₀ sinθ · t − ½ g t²
Setting y = 0 gives the time of flight T = 2 v₀ sinθ / g, and the range R = v₀² sin 2θ / g. Since sin 2θ is maximised at 2θ = 90°, the optimal angle is 45° for level ground with no air resistance.
With air resistance the drag force Fₐ = ½ ρ Cₐ A v² (where A = πr² is cross-sectional area) slows the ball and shifts the optimal angle below 45° — typically to 30°–40° depending on speed and ball properties.
The range envelope curve (dashed) connects the tips of all possible trajectories at a given launch speed — every point inside it can be hit at two different angles; points outside it are unreachable. The envelope itself is an ellipse with the equation R·g = v₀² − (gx)²/v₀² (parabola of safety).
Magnus effect: Spinning balls (footballs, golf balls, baseballs) experience an additional lift/deflection force perpendicular to their velocity, curving trajectories away from the simple parabola seen here.
Sports applications
A shot-put athlete should aim close to 42° (drag reduces the optimum). A football kicked at 30° travels farther than one kicked at 60° — both have the same vacuum range, but air resistance punishes higher, slower arcs more. In archery and javelin, competitors intuitively converge on these drag-adjusted optima.
About this simulation
This simulator numerically integrates a fired projectile's motion with semi-implicit Euler steps at a fine 0.005 s timestep (four sub-steps per animation frame): each step adds gravitational acceleration and, if enabled, quadratic air drag Fₐ = ½ ρ Cₐ A v² — sized by the ball's radius (cross-section A = πr²) and mass — to the velocity, then advances position from that velocity. The live yellow trail keeps stepping until the ball crosses y = 0, at which point it linearly interpolates the exact landing point. Five reference arcs at 15°–75° are recomputed with identical physics whenever a slider changes, and the dashed envelope curve is the closed-form drag-free parabola of safety R·g = v₀² − (gx)²/v₀², all instantly rescaled when gravity switches between Moon, Earth, and Jupiter.
What it shows
A cannonball's parabolic flight with a fading yellow trail, a grey cannon that rotates to match the launch angle, dashed markers for range and peak height once it lands, five faint comparison arcs at fixed angles (15°–75°), and the dashed range-envelope curve that bounds every reachable point at the current launch speed.
How to use it
Drag the Speed and Angle sliders, pick a gravity body (Moon/Earth/Jupiter), then press Fire (or hit P) to launch — Reset (R) clears the field. Toggle Air Resistance to add drag and fine-tune drag coefficient Cₐ, radius, and mass; toggle the Multi-angle and Envelope overlays independently.
Did you know?
45° is only optimal in a vacuum. Once air drag is switched on, the best angle drops to roughly 30°–40° because drag punishes the extra time-in-flight of steeper, slower arcs more than it punishes the extra speed of flatter ones — which is why javelin and shot-put throwers release well below 45°.
Frequently Asked Questions
How exactly does the simulator land the ball at the marked range?
Each of the four physics sub-steps per frame updates velocity from gravity (and drag, if on) and then position from that velocity — semi-implicit Euler integration at dt = 0.005 s. Once the height crosses below zero, the simulator uses the previous and current points to linearly interpolate the exact crossing time and position, which is what the yellow range marker displays; this happens independently of the frame rate, so the reported range and time of flight stay accurate even if your browser drops frames.
Why does turning on air resistance change the optimal 45° angle?
Without drag, range R = v₀²sin(2θ)/g is maximised exactly at θ=45° because sin(2θ) peaks at 2θ=90°. Drag force scales with v² (Fₐ = ½ρCₐAv²) and acts for the entire flight, so a steeper 45° shot loses proportionally more energy to drag than a flatter shot with the same vacuum range. The simulator recomputes all five reference arcs and the live trajectory with the exact same drag law, so you can watch the optimal angle visibly drop toward 30°–40° as you increase Cₐ, radius, or speed.
What do the drag coefficient, radius, and mass sliders each control?
Drag coefficient Cₐ describes the ball's shape (0.47 is a smooth sphere); radius sets the cross-sectional area A=πr² the air pushes against; mass sets how much that push actually decelerates the ball, since acceleration from drag is Fₐ/mass. A light, large-Cₐ, large-radius ball (imagine a beach ball) is dragged down hard and lands short of its vacuum range; a heavy, small, streamlined one (a shot-put) barely deviates from the pure parabola traced in the formula box.
How does switching gravity (Moon/Earth/Jupiter) change the trajectory?
Range, max height, and time of flight all divide by g in the drag-free equations, so every one of them scales as 1/g. Switching from Earth's 9.81 m/s² to the Moon's 1.62 m/s² multiplies range, height, and time of flight by roughly 6×, with everything recomputed instantly — including the five comparison arcs and the envelope curve, which is itself proportional to v₀²/g.
Why do the five comparison arcs and the envelope curve matter?
The five fixed-angle arcs (15°, 30°, 45°, 60°, 75°) let you see, without firing repeatedly, how launch angle trades off height for range at the current speed and gravity — notice 15° and 75° land at the same range (they're complementary angles, sin(2·15°)=sin(2·75°)), while 45° reaches farthest without drag. The dashed envelope curve is the ‘parabola of safety’: it traces the outer boundary of every point reachable at the given launch speed from any angle, so anything outside the dashed line simply cannot be hit at that speed, no matter the angle chosen.