Relative Motion of Two Trains Crossing Each Other

March 26, 2026

Problem

Two trains are moving in opposite directions: Train A: 60 km/h, length 100 m Train B: 40 km/h, length 150 m 👉 Question: Time to completely cross each other?

Explanation

We have two trains moving towards each other on parallel tracks.

  • Train A speed: 60 km/h, length: 100 m
  • Train B speed: 40 km/h, length: 150 m

We want the time taken to completely cross each other. That means the time from the moment their front ends meet until their rear ends completely pass each other.


1. Convert speeds to consistent units

Lengths are in meters, so convert speeds from km/h to m/s:

1 km/h=1000 m3600 s=518 m/s1\,\text{km/h} = \frac{1000\,\text{m}}{3600\,\text{s}} = \frac{5}{18}\,\text{m/s}
  • Train A speed:
vA=60×518=30018=16.67 m/s (approx)v_A = 60 \times \frac{5}{18} = \frac{300}{18} = 16.67\ \text{m/s (approx)}
  • Train B speed:
vB=40×518=20018=11.11 m/s (approx)v_B = 40 \times \frac{5}{18} = \frac{200}{18} = 11.11\ \text{m/s (approx)}

2. Relative speed (opposite directions)

When two objects move towards each other, their relative speed is the sum of their speeds:

vrel=vA+vBv_{\text{rel}} = v_A + v_B

So:

vrel=16.67+11.11≈27.78 m/sv_{\text{rel}} = 16.67 + 11.11 \approx 27.78\ \text{m/s}

3. Total distance to be covered while crossing

For the trains to completely cross each other, the front of one must travel past the rear of the other. Effectively, they need to cover the sum of their lengths:

Ltotal=LA+LB=100+150=250 mL_{\text{total}} = L_A + L_B = 100 + 150 = 250\ \text{m}

4. Time to completely cross

Use the basic motion formula:

Time=DistanceRelative speed=Ltotalvrel\text{Time} = \frac{\text{Distance}}{\text{Relative speed}} = \frac{L_{\text{total}}}{v_{\text{rel}}} T=25027.78≈9.0 seconds (approximately)T = \frac{250}{27.78} \approx 9.0\ \text{seconds (approximately)}

So, the two trains will completely cross each other in about 9 seconds.


How the visualization works

This interactive visualization shows:

  • Two colored rectangles representing the trains on a track, moving towards each other.
  • Their speeds, lengths, and whether they move in opposite or same directions are adjustable.
  • A computed crossing time is shown on screen using the formula:
T=LA+LB∣vA−s vB∣T = \frac{L_A + L_B}{\lvert v_A - s\,v_B \rvert}

where:

  • Speeds are converted from km/h to m/s inside the visualization.
  • s=−1s = -1 for opposite directions (adds speeds) and s=+1s = +1 for same direction (takes the difference).

A time slider lets you scrub the motion to see how the trains overlap until they have completely passed each other. The neon colors follow:

  • Train A: cyan
  • Train B: pink
  • Track and helper text: yellow

You can also reset to the given problem to see visually why the answer is about 9 seconds.

Interactive Visualization

Parameters

60.00
100.00
40.00
150.00
0.00
Relative Motion of Two Trains Crossing Each Other