Final answer:
In physics, when light passes through a medium, it can be refracted, or change direction. The reason why the light turns yellow before entering an intersection is because the yellow light is in between the green and red lights on the electromagnetic spectrum. This is done to provide a warning to drivers to slow down and prepare to stop.
Step-by-step explanation:
In physics, when light passes through a medium, it can be refracted, or change direction. This is what happens when light passes through a traffic light. The reason why the light turns yellow before entering an intersection is because the yellow light is in between the green and red lights on the electromagnetic spectrum.
When the light passes through a prism or a traffic light, it gets separated into different colors, with yellow appearing in between green and red. This is done to provide a warning to drivers to slow down and prepare to stop.