Alhazen earned his living by transcribing and selling all the geometric works by Greek mathematician Euclid, consequently developing a technical mastery of straight lines and motion. Later he found employment at the court of the powerful caliph al-Hakim in Cairo, who encouraged the enterprise of learning and technique as he obsessively wished to control all elements in the world around him. In a suspiciously apocryphal story his career as a scientist was transformed when he was commissioned by the caliph on the project to stop the River Nile's unpredictable floods and droughts. Alhazen, quickly concluding the undertaking's doom to failure, feigned insanity in order to escape the caliph's wrath. Unfortunately the plan did not succeed and he was sentenced to ten years under house arrest.
Under police control, and at times under aphotic conditions, Alhazen began to meditate on what he could see, becoming obsessed with light and dark. He began with the enigmatic and universal problem, asking whether light and vision could be entirely explained by the combined effort of mathematics and geometry. He questioned the classical idea, the accepted dogma for a thousand years, that sight was due to light coming out of a human eye, touching an object to produce vision (extramission). He countered that extramission could not explain vision because a person would experience severe pain in the eye while looking at a very bright object like the sun, when such pain should not exist had the eye been the source, not the recipient, of light. Though extramission could be refuted, very little evidence existed supporting intromission as it was very difficult to argue that a coherent, miniature version of an entire object could be received by the human eye, the nature of that shortening in the eye, and physical location of the corresponding projection.
Work in optics
Alhazen was most original in his theory of light and vision, where he proceeded by experiment and induction, and again voiced skepticism of past authorities such as Euclid (c. 300 BC) in his Optics whose ideas supported the extramission theory of vision. Alhazen rejected the classical concept of the visual cone emanating from the eye, pointing out the error in the assumption that some form of radiance could flow from the eye the moment it was opened and illuminate the entire heavens, as though the eye was like a torch sending fire to the object and making it visible (not far from the modern concept of radar).
Alhazen questioned Aristotle's "emanating forms" by which an object's "essence" flows into the eye abstracted from the actual matter. Searching for a more satisfactory explanation, he analyzed ideas about cone-shaped beams that emanate from the eye, illuminating the object, defined by straight geometric lines. Here he agreed to the mathematical approach but spotted extramission's flaw, as it could not explain why the eye hurts when looking at a bright object, but not dim one, or why nocturnal hours are observed. Inspried, he combined the two Greek ideas, defining the modern explanatino of vision : light does travel in straight lines, obeying geometric laws, and travel not out of, but, into, the eye.
Alhazen surmized that if light was independent of the eye, some mechanism had to redirect light into the eye. He realized there was a clue in the function of mirrors, claiming that light rays must be brought back (or make the object send back) some kind of visual packet to the eye. Studying those patterns, Alhazen uncovered the symmetry that the angles of incident and reflected light are equal (the angle at which light hits an object is the same as its reflection), analogous to the way a ball struck at, and rebounded from, a wall.
He made a breakthrough in realizing that light rebounds off all objects not just mirrors and precisely developed via mathematics how light bounces off (reflection) and bends through (refraction) and object. He validated the intromission hypothesis of vision by explaining light from luminous bodies is received by all other objects, which also become luminous. Alhazen was the first to employ the concept of rays of light travelling in straight lines from every point on its source in all directions, a critical advance on the classical theory that objects emitted coherent, tiny copies of themselves. In his improved model of vision, the eye was the recipient of light from the perceived object, creating a 'form' representation that enters the pupils, which act as lenses that bend light, and proceed to the brain, where sense completes the process.In the year 1021, twelve years into his prison sentence, the caliph died and Alhazen was set free and produced seven volumes that covers light and vision, transforming its mathematical rules and enacting the modern study of optics. His texts remained fundamental from the thirteen to the seventeenth centuries in the east and west, where Latin editions of Alhazen were studied by Johannes Kepler, Pierre de Fermat and Rene Descartes. Alhazen's book, Kitab al-Manazir or De Aspectibus or Book of Optics assimilated the physical, mathematical, and physiological aspects of vision.
Other pioneering work
Alhazen virtually studied every aspect of light and human sight. He examined how light was bent (refracted) by water, bounced off (reflected) flat, smooth surfaces, and nearly converged on a theory of the magnifying lens. He examined the rainbow and explained the psychology of perception concerning the apparent moon diameter as the body approaches the horizon (an optical illusion caused by the expected size in relation to familiar objects on the ground), and demonstrated how refraction by the atmosphere causes the sun to be still visible when it is actually below the horizon. He deduced that the earth's atmosphere is of a finite thickness (recalling the problem of refractive index in a glass of water), estimating the thickness to be about 40,000 meters (approximately half of the modern value).
In order to study a solar eclipse, Alhazen cut a small hole in a wall, allowing the somewhat clear image to be projected through it onto a flat surface (an early example of the camera obscura).
Alhazen was one of the first scholars to argue that scientific ideas are only valid if mathematically consistent and reflect reality. He spotted a fundamental contradiction about Greek astronomy -- on the one hand that all planets revolve about the earth, but on the other, that according to Ptolemy planets revolve about an imaginary point in space away from the earth, known then as the Equant. In his treatise Al-Shukuk ala Batlamyus or Doubts on Ptolemy. In it Alhazen uncovers where Ptolemy himself realized the fundamental reasoning problem.
Unfortunately, Alhazen considered colors distinct from white light; he did not provide a satisfactory justification of how light refracted in the eye not through its center, is perceived.