Ibn Sahl (c. 940–1000), a mathematician and physicist connected with the court of Baghdad, wrote a treatise On Burning Mirrors and Lenses in 984 in which he set out his understanding of how curved mirrors and lenses bend and focus light. Ibn Sahl is credited with discovering the law of refraction, now usually called Snell's law. He used this law to work out the shapes of lenses that focus light with no geometric aberrations, known as anaclastic lenses.