
The father of optics — how one scholar in 11th-century Cairo invented the scientific method and explained how we see.
The Madman of Cairo
In the year 1011, the Fatimid Caliph al-Hakim summoned a scholar named Ibn al-Haytham (known in the West as Alhazen) to Cairo with a grand commission: build a dam on the Nile to control its annual flooding.
Ibn al-Haytham traveled south to study the river. He quickly realized the project was impossible — the engineering required was beyond anything the 11th century could achieve (the Aswan Dam would not be built for another 900 years). But telling the Caliph that his project was impossible was dangerous — al-Hakim was known for executing people who disappointed him.
Ibn al-Haytham did something remarkable: he pretended to be insane. The Caliph, rather than executing a madman, placed him under house arrest. For the next ten years, confined to a room in Cairo, Ibn al-Haytham conducted the experiments that would make him the most important scientist of the medieval world.
The Revolution
Before Ibn al-Haytham, the dominant theory of vision — held by Euclid, Ptolemy, and most Greek thinkers — was the emission theory: the eye sends out rays that touch objects and return with information about their shape and colour. This is intuitive (you "look at" things, directing your gaze like a searchlight) but completely wrong.
Ibn al-Haytham proposed the opposite: intromission theory. Objects are illuminated by an external light source (the Sun, a candle). Light bounces off the object in all directions. Some of that reflected light enters the eye, where it forms an image. We see because light comes IN to the eye, not because something goes OUT.
This seems obvious today. It was revolutionary in 1011. And Ibn al-Haytham didn't just assert it — he proved it through a series of experiments that established the foundations of the scientific method.
The Dark Room
Ibn al-Haytham's most famous experiment used a dark room — a chamber with a single small hole in one wall. He placed candles at various positions outside the hole and observed the light that entered.
He discovered that light from each candle traveled in a straight line through the hole and projected an inverted image on the opposite wall. When he blocked one candle, its corresponding spot of light disappeared, proving that each light source produced its own independent rays.
This was the camera obscura — literally "dark room" in Latin. It is the ancestor of every camera ever built, and it demonstrated three fundamental principles of optics:
1. Light travels in straight lines (rectilinear propagation) 2. Light from different sources does not interact (the rays cross at the hole without interfering) 3. An image is formed by the convergence of many individual light rays, each carrying information from a different point on the source
Refraction
Ibn al-Haytham then turned to refraction — the bending of light as it passes from one medium to another (from air to water, or air to glass).
He built apparatus to measure the angle of refraction precisely — observing how light bent as it entered water or glass at different angles of incidence. He discovered that the relationship between the angle of incidence and the angle of refraction was not linear (as earlier scholars had assumed) but followed a more complex pattern.
He didn't derive Snell's Law (the exact mathematical relationship, sin θ₁ / sin θ₂ = n₂ / n₁), but his measurements were precise enough that the law could have been extracted from his data. Snell independently discovered it 600 years later, in 1621.
Ibn al-Haytham also studied atmospheric refraction — the bending of light by the atmosphere, which makes the Sun appear to be above the horizon when it has actually already set. He calculated the height of the atmosphere from the duration of twilight — an estimate that, while not exact, demonstrated a sophisticated understanding of the atmosphere as a refracting medium.
The Method
What made Ibn al-Haytham truly revolutionary was not any single discovery but his method. In his masterwork, Kitab al-Manazir (Book of Optics), he laid out a systematic approach to investigating nature:
1. State the problem clearly 2. Form a hypothesis (a tentative explanation) 3. Design an experiment to test the hypothesis 4. Observe the results and record them accurately 5. Draw conclusions — and if the results contradict the hypothesis, abandon the hypothesis, not the results
This is the scientific method — and Ibn al-Haytham described it explicitly, six hundred years before Francis Bacon (often credited as the father of the scientific method in Western tradition) wrote Novum Organum in 1620.
Ibn al-Haytham was especially insistent on the importance of skepticism — even skepticism toward established authorities. He wrote: "The seeker after truth is not one who studies the writings of the ancients and, following his natural disposition, puts his trust in them, but rather the one who suspects his faith in them and questions what he gathers from them."
The Legacy
The Book of Optics was translated into Latin in the late 12th century and became the standard textbook on light and vision in European universities for the next 400 years. It influenced Roger Bacon, Kepler, Descartes, and Newton — all of whom built on Ibn al-Haytham's foundations.
The camera obscura that Ibn al-Haytham described became a tool for artists (Vermeer likely used one), astronomers (for safely observing solar eclipses), and eventually, in the 19th century, the basis of photography — when someone figured out how to make the image on the back wall permanent.
From a dark room in Cairo, under house arrest, pretending to be insane, one man built the foundations of optics, established the scientific method, and changed how humanity understands light, vision, and the pursuit of truth.
The end.
Choose your level. Everyone starts with the story — the code gets deeper as you go.
Here is a taste of what Level 1 looks like for this lesson:
import numpy as np
import matplotlib.pyplot as plt
# Your first data analysis with Python
data = [45, 52, 38, 67, 41, 55, 48] # measurements
mean = np.mean(data)
plt.bar(range(len(data)), data)
plt.axhline(mean, color='red', linestyle='--', label=f'Mean: {mean:.1f}')
plt.xlabel("Sample")
plt.ylabel("Value")
plt.title("Optics & the Scientific Method — Sample Data")
plt.legend()
plt.show()This is just the first of 6 coding exercises in Level 1. By Level 4, you will build: Build an Optics Simulator.
Free
Level 0: Listener
Stories, science concepts, diagrams, quizzes. No coding.
You are here
Level 0 is always free. Coding levels (1-4) are part of our 12-Month Curriculum.
How light works — straight-line propagation, refraction, the camera obscura, and the invention of experimental science.
The big idea: "Ibn al-Haytham and the Science of Light" teaches us about Optics & the Scientific Method — and you don't need to write a single line of code to understand it.
Close your eyes. What do you see? Nothing. Now open them. The room appears. What changed? Your eyes didn't send out searchlight beams to scan the room. Light from the room — reflected from every surface — entered your eyes. You see because light comes IN, not because something goes OUT.
This seems obvious today. But for over a thousand years, the greatest thinkers in the world — Euclid, Ptolemy, and most Greek philosophers — believed the opposite. They thought your eyes emitted "visual rays" that went out, touched objects, and returned with information. This is called the emission theory of vision.
Think about why it's intuitive: you "look at" things. You "direct your gaze." You "cast your eyes" across a room. The language itself implies that seeing is something you do, not something that happens to you. The emission theory felt right, even though it was completely wrong.
Ibn al-Haytham proved it was wrong with a simple argument: if your eyes emitted rays, you should be able to see in complete darkness — your rays would illuminate whatever they touched. But you can't see in the dark. Therefore, vision depends on external light, not internal rays. You see when light from an illuminated object enters your eye. Period.
Check yourself: In a pitch-dark room, your pupils dilate (open wider). Why would your eyes do this if vision were based on emitting rays? (They wouldn't. Dilation increases the amount of incoming light — proof that your eyes are designed to receive, not emit.)
Key idea: We see because light enters our eyes, not because our eyes emit anything. Ibn al-Haytham disproved the emission theory (held for 1,000+ years) with a simple observation: you can't see in the dark, so vision must depend on external light, not internal rays.
Ibn al-Haytham's most famous experiment used a dark room — a chamber sealed from all light except for a single small hole in one wall. Outside, he placed candles at different positions.
On the wall opposite the hole, something appeared: an image of the candles — upside down and reversed left-to-right. Each candle produced its own spot of light on the far wall. When he covered one candle, its corresponding spot vanished. When he moved a candle, its spot moved too.
This proved three fundamental things about light: (1) Light travels in straight lines — rays from the candle pass through the hole in straight paths and hit the wall on the other side. (2) Light from different sources doesn't mix — the rays from separate candles cross at the hole without interfering with each other. (3) An image is formed by the convergence of many independent rays, each carrying information from a different point on the source.
This device is the camera obscura — literally "dark room" in Latin. It is the ancestor of every camera ever built, from the first daguerreotype (1839) to the one in your phone right now. The basic principle is identical: light passes through a small opening and projects an inverted image on a surface.
Try this: On a sunny day, go into a dark room and make a tiny hole (about 3 mm) in a piece of cardboard covering the window. Hold a white sheet of paper about 30 cm from the hole. You'll see an upside-down, dim image of the outside scene — trees, buildings, clouds, all projected onto the paper. You've just built Ibn al-Haytham's camera obscura.
Key idea: Light from each point on an object travels in a straight line through a small hole and hits the opposite wall, forming an inverted image. This proves light travels in straight lines, doesn't mix, and carries information from its source. The camera obscura is the ancestor of all cameras.
Access all 130+ lessons, quizzes, interactive tools, and offline activities
Put a straw in a glass of water and look from the side. The straw appears to **bend** at the water's surface. It's not actually bent — if you pull it ...
Ibn al-Haytham didn't just make discoveries about light. He described a **method** for investigating nature that was revolutionary in the 11th century...