For a given frequencyThe number of waves produced each second. The unit of frequency is hertz (Hz). of light, the wavelengthThe length of a single wave, measured from one wave peak to the next. is proportionalA relationship between two variables, eg in a gas. As temperature increases, the pressure would also increase proportionally. (If the temperature doubled, the pressure would double). to the wave velocity, or speed:
wave speed = frequency × wavelength
This means that if a wave slows down, its wavelength will decrease. For example, if the wavelength decreases by a factor of three, the wave velocity, or speed, will also decrease by a factor of three, as frequency stays the same.
The effect of this can be shown using wave front diagrams, like the one below. The diagram shows that as a wave travels into a denser medium, such as water, it slows down and the wavelength decreases. Although the wave slows down, its frequency remains the same, due to the fact that its wavelength is shorter.
In this diagram, the right hand side of the incoming wave slows down before the left hand side does. This causes the wave to change direction, meaning it has been refracted.