Two train going 40 and 50 mph for 3 hours.
One train goes 3*40 = 120 miles, while the other train goes 3*50 = 150 miles.
If they go in the same direction. One train will be behind the other by 150-120 = 30 miles.
If they go in opposite directions. They will be 120+150 = 270 miles apart.
If one goes south and the other goes east or west, we new to use the Pythagorean Theorem
square root ( 120^2 + 150^2) = 192.094