How to find overlap interval of two objects moving parallel in opposite direction

351 Views Asked by At

If two objects, let's say 2 trains, both of which are 10m in length, are moving on tracks parallel to each other, but each train is moving in the opposite direction. The first train is moving 5 m/s and the second train is moving 7 m/s. How do I find the amount of time that each train "overlaps" (Let's say, the time frame in which passengers from one train can see passengers in the other train)