How waves and light are related