This animation has been created to illustrate the phenomenon of wave refraction. Refraction of a wave occurs when a wave passes from one medium to another in which it has a different speed.
If a wave crosses a boundary between two media 1 and 2 in which the wave speeds are v1 and v2 respectively, then the ratio v1/v2 obeys Snell’s law of refraction:
v1/v2 = sin θ1/sin θ2 = λ1/λ2
where θ1 and θ2 are the angles made by the waves and the normal to the boundary (the dashed line in the animation) in media 1 and 2 respectively. The symbols λ1 and λ2 correspond to the wavelength in the media 1 and 2 respectively.
This example shows that by moving from a medium with high wave speed to a medium with low wave speed, waves are refracted towards the normal. When going from a medium with low wave speed to a medium with high wave speed, it will be refracted away from the normal as you can see by imagining this animation running backwards.