Avoid Crash

☰ button brings up a control panel

Animation starts with a yellow truck entering from the left and moving with constant velocity to the right. It is followed by a green truck. The green truck's motion is initially uniform, but it can be slowed down when it is at a set distance behind the yellow truck. The distance parameter is the distance between the two trucks when the rear truck begins to slow down. Try and find ways of avoiding collision between the trucks. (This distance is the distance between the rear end of yellow truck and the front end of the green truck)

Distances are measured from the left to the rear end of yellow truck and from left to the front end of the green truck. Time is measured from the moment when the green truck appears at the left end.