Lapping

← All projects

Two people race round a track, and one is faster than the other. How long until the faster one laps the slower one? The answer is one short equation, and the same equation tells you when the hands of a clock meet, why the Moon's phases repeat every 29½ days and not every 27⅓, and how often the Earth overtakes Mars.

Z = (X × Y) / (X − Y)

X is the slower runner's lap time, Y the faster runner's, and Z the time between one passing and the next.

Michael Carnright worked this equation out for himself at sixteen. It is the same relation astronomers use for a synodic period, the time for two orbiting bodies to come back into line, though he arrived at it from two runners on a track. The page and its code are by Claude Code.

Watch it

● , a lap every
● , a lap every

Laps every

Time:
Passes so far: 0

Why it works

Measure speed in laps per unit of time. The faster runner covers 1/Y of a lap each unit of time and the slower one 1/X, so the faster runner pulls ahead by 1/Y − 1/X of a lap each unit. It passes the slower runner again when it has pulled ahead by one whole lap:

Z × (1/Y − 1/X) = 1

and solving for Z gives Z = 1 / (1/Y − 1/X) = XY / (X − Y). In that time the faster runner has run Z/Y = X/(X − Y) laps and the slower one Z/X = Y/(X − Y), exactly one fewer.

Nothing in this needs the runners to start together, or the track to be any particular length. Only the two lap times matter. That is why the same equation fits a clock face and the solar system: anything that goes round and round at a steady rate is a runner on a track.

The surface

Michael also plotted the equation in Grapher as a surface, in a file he called Mars chasing Earth or minute hand chasing hour hand: z = (x⋅y)/(x − y) over every pair of lap times. Here it is again, for lap times from 0 to 12. Drag it to turn it.

■ X larger than Y: Z is positive. ■ Y larger: the runners have swapped roles and Z comes out negative, the same size as if you swapped X and Y. ● the X and Y set above, when they are 12 or less. The surface is cut off flat at Z = ±36; near the dashed line x = y it goes on rising for ever.

The surface shows the whole story at a glance. Along the line x = y it shoots off to infinity: two runners at the same speed never pass. Far from that line it flattens out, and along the y axis, where the faster runner's lap time is near zero, z is near zero too. Double both lap times and z doubles, so the surface is made of straight lines running out from the origin, which the grid lines on it show. Every pair in the table below is one point on this surface.

The examples

PairX (slower)Y (faster)Z (laps every)

Orbital periods are sidereal, measured against the stars: the Earth's year 365.256 days, the Moon's month 27.322 days, Mars 686.98 days, Venus 224.70 days.