What this simulation shows
Every velocity is measured by someone. A cup on the table of a moving train is still for the person drinking from it, yet it races past anyone standing by the line. This simulation lets you pick the observer and watch the same motion through different eyes.
There are two scenes. In the first, two trains run along parallel tracks at steady velocities that you choose, with plus meaning to the right. In the second, a boat crosses a river while the water flows downstream. Use Watch from to switch the observer at any moment, even while the motion is running. The trains and the boat carry on exactly as before; only the view changes.
Changing the observer
Choose an observer and the drawing follows them, so they stay in the middle of the stage while the rest of the scene slides by. The arrows then show the velocities that observer would measure. A passenger always finds their own train at rest, and the trackside poles drift backwards at the train's speed.
The rule behind every arrow is a subtraction. To get the velocity of B as measured from A, take A's velocity away from B's:
Trains on parallel tracks
When both trains head the same way, the minus sign leaves only the difference of their speeds, so overtaking is a slow affair. When they head opposite ways, one velocity is negative and subtracting it adds the speeds. Two trains meeting at a combined speed of 40 m/s are past each other in a few seconds.
The Time to pass card measures how long the trains spend side by side. From either train, the other must slide along both train lengths at the relative speed, so the time is the total length divided by the size of the relative velocity. Set equal velocities and nothing passes at all: each passenger sees the other train hang beside the window.
Crossing a river
The boat has a speed through the water and a heading. The water also moves, carrying the boat downstream. Its velocity relative to the bank is the vector sum of the two. With the boat pointing straight across, these velocities are at right angles, and Pythagoras gives the speed over the bank.
Something surprising follows. The current pushes only along the river, so it cannot speed up or slow down the trip across. The crossing time depends on the width and on the part of the boat's own velocity pointing across. A strong current makes the boat land further downstream, but it arrives at the same moment.
To land straight opposite, turn the boat upstream until the upstream part of its velocity cancels the current. Less of its speed then points across, so the trip is slower. Watch from Water to see why: relative to the water, the boat simply goes the way it points, and the banks drift upstream past it.
Simplifications and course notes
The tracks are straight and level, and the velocities never change. The current is the same everywhere across the river, although a real river usually flows faster in mid-channel than near its banks.
Punjab Class 9 teaches that rest and motion are relative. Cambridge IGCSE Supplement adds two velocities at right angles, as in the straight-across crossing. AQA GCSE treats velocity as a vector but leaves relative velocity out. Calculating relative velocities along a line and at an angle is taken further in AP Physics 1 and in senior-secondary physics, and vector addition of velocities appears again at A Level.