Simulation

Cannon on a Moving Cart SimulatorFire from a Rolling Cart

KinematicsProjectile motion

A cannon rides a cart rolling at constant speed and fires a shell at an angle; the shell inherits the cart's horizontal velocity, so its ground-frame path differs from the symmetric arc seen in the cart's own frame.

Published: June 8, 2026

Objective

Demonstrate velocity addition (Galilean relativity) for a cannon riding a moving cart: the shell is fired at speed v_launch and angle θ in the cart's frame, and on the ground its horizontal velocity is the vector sum vₓ = v_cart + v_launch·cos(θ), while its vertical velocity v_y = v_launch·sin(θ) is untouched by the cart's motion. Confirm that the ground-frame path is a stretched, slanted arc while the cart-frame path is a symmetric arc straight over the cannon, that both views describe one and the same flight, and that the ground range exceeds the cart-frame range by exactly the distance the cart travels, v_cart·T. The shell is a point mass with no air resistance.

Setup

  1. On a fresh canvas the third button reads Reset; if earlier arcs are on screen it reads Clear; press Clear to wipe them. Set the cart speed to 8 m/s, the launch speed to 20 m/s, and the angle to 50° (the defaults), then press Start.
  2. Watch the shell arc up and over while the cart rolls beneath it. In the ground frame the arc leans forward and stretches; the Ground range readout climbs while the Cart range readout tracks the shell's position relative to the moving cannon.
  3. Wait for the landing (≈ 3.12 s). The Ground range reads ≈ 65 m and the Cart range ≈ 40 m: the 25 m difference is exactly how far the cart rolled. Press Reset: the arc stays on the canvas as a faded grey ghost.
  4. Press the View button to switch to the cart frame. The very same flight now redraws as a symmetric arc straight over the cannon, peaking at ≈ 12 m: the cart's 8 m/s has been subtracted out. The ghost redraws in the new frame too.
  5. Press Reset, raise the cart speed to 12 m/s (keep the angle and launch speed), and press Start. In the ground frame the arc leans further forward; switch to the cart frame and it is the identical symmetric arc: cart speed never touches the shape seen from the cart. Press Clear when you are done comparing.
The Cannon on a Moving Cart simulator at the start of a run.

Analytical Prediction

Firing at angle θ in the cart's frame, the shell's ground-frame velocity components add the cart's horizontal speed to the launch's horizontal component, while the vertical component is untouched:

vₓ=v_cart + v_launch·cos(θ)
=8 + 20·cos50°
20.9 m/s
v_y=v_launch·sin(θ) = 20·sin50° ≈ 15.3 m/s

The flight time and peak height depend only on the vertical component:

T=2·v_y / g = 2 × 15.3 / 9.81 ≈ 3.12 s
H=v_y² / (2g) ≈ 12.0 m

The ground range is vₓ·T while the cart-frame range drops the inherited part:

R_ground=vₓ · T ≈ 20.9 × 3.12 ≈ 65.1 m
R_cart=v_launch·cos(θ) · T ≈ 12.9 × 3.12 ≈ 40.2 m

Their difference, R_ground − R_cart = v_cart·T ≈ 25 m, is exactly the distance the cart rolls during the flight.

Results Analysis

Read the two range readouts side by side: Ground range measures x_shell − x_launch in the fixed ground frame, Cart range measures x_shell − x_cart relative to the moving cannon. At landing the first should read ≈ 65 m and the second ≈ 40 m, and their gap equals v_cart·T ≈ 25 m. Toggle the View button mid-comparison: the cart-frame arc is symmetric about the cannon and peaks at H ≈ 12 m regardless of cart speed, because the cart's velocity drops out of the vertical motion entirely. The ground-frame arc, by contrast, leans forward and stretches as cart speed rises. With Reset keeping each arc as a ghost, overlay several cart speeds at fixed angle and launch speed: in the cart frame every arc lands on the same point over the cannon, while in the ground frame each lands farther downrange, the visual signature of velocity addition.

The Cannon on a Moving Cart simulator after a completed run.

Source of Error

The model assumes a point-mass shell with no air resistance, a frictionless level track, and a cart holding a perfectly constant speed. Real cannons recoil, real carts feel rolling friction, and air drag would act on the shell's full ground-frame speed (largest when the cart and launch velocities add head-on), pulling the landing short of the ideal range. Because the prediction and the simulation share the same idealisations (constant cart speed, no drag), the ground/cart range gap is exactly v_cart·T here and any residual is numerical, not physical. Velocity addition is exact only while no horizontal force acts on the shell after launch; drag breaks the clean frame symmetry because it depends on ground speed, which differs between the two frames.

Further Exploration