🎯 Projectile Motion
Interactive projectile motion simulator: adjust launch angle and speed, compare trajectories with and without air resistance, discover the 45° optimal angle, and overlay multiple arcs.
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.
Fire a projectile and explore how launch angle, speed, air resistance, and gravity affect the trajectory. Overlay 5 arcs at 15-75 degrees, see the range envelope, compare Earth vs Moon vs Jupiter gravity.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install