Alhazen (full name Abu Ali al-Hasan Ibn al-Haitham) was the son of a civil servant and consequently relatively well educated. In the course of his reading he became fascinated by the flooding of the River Nile. He reasoned that constructing a dam would enable water to be stored for irrigation in the dry season, and flooding could be prevented at other times.
He pitched his idea to the ruler of Egypt, Caliph al-Hakim. The Caliph was intrigued, and provided financial backing and workmen. On arrival at the dam's proposed site at Aswan, Alhazen realised that he had insufficient money, materials or labour to complete the project successfully. Not wanting to waste money, but concerned at the price he might have to pay for failure, he pretended to be insane, a pretence he was required to keep up until the Caliph died twelve years later.
By the time the Caliph had died, in 1021, Alhazen was teaching in Cairo, where he lived out his life. He spent much of his time conducting experiments, of which many involved a dark room with a hole in it. He hung five lanterns outside the room, adjacent to the wall with the hole, and noticed that there were five 'lights' on the wall inside his dark room. He would then place an obstruction between one of the lanterns and the hole, and observed one of the 'lights' on the wall disappear. Furthermore the lantern, the obstruction and the hole were in a straight line.
This demonstrated both that light travelled in straight lines and that, even though the light from the five lanterns all travelled through the little hole at the same time, it did not get mixed up: there were five 'lights' on the wall inside the room. He deduced that this is how the eye worked, which had been the subject of a long debate. Aristotle had believed the eye sent out rays to scan objects, but Alhazen believed the opposite to be true, that light was reflected into the eye from the things one observed, thus overturning a thousand years of scientific thought. His experiment was the first scientific description of the 'camera obscura' (dark room), the principle behind the pinhole camera.