The enduring image of a moth frantically circling a nocturnal light source—whether candle, campfire or electric bulb—has long intrigued both scientists and literary types, including Shakespeare.