Home › Qibla › His discovery was credited to a man born four centuries after him
Episode 5 · Cairo · 7 min read
His discovery was credited to a man born four centuries after him
Lay a ruler on a world map, between Beijing and Mecca. Follow the bearing you just read. You will land two thousand three hundred kilometres from the city. Finding the direction of prayer from any point on Earth occupied scholars of the Muslim world for centuries, and the first general solution carried the wrong name for a long time.
A ruler on a map gives a false bearing
The calculation is easy to redo. Beijing sits at 116.41° east and 39.90° north, the Kaaba at 39.83° east and 21.42° north. On an equirectangular map, the one everyone pictures, the segment joining the two cities makes an angle of 256.4° with north. The true direction, that of the shortest path across the surface of the globe, is 278.9°. The gap is 22.5°.
Twenty-two degrees sounds small. Over the 7,386 kilometres between the two cities, it makes you miss the target by 2,286 kilometres: holding the bearing read off the ruler, you do not reach Mecca but the Indian Ocean, off the coast of Somalia.
The reason fits in one sentence. A map is flat, the Earth is not. On a sphere the shortest path between two points is not a straight line but a great-circle arc, and the bearing to hold at departure is not the one the eye reads on a projection.
What a mosque is looking for

Every mosque in the world is built around a direction. It is called the qibla, and it is the direction of the Kaaba, at the centre of Mecca. A wall carries it, a niche marks it, and five times a day the congregation turns toward it. From Xi'an to Djenné, from Cordoba to Touba, buildings that share neither shape nor material nor century all aim at the same point on the globe.
Hence the problem set before the builders, and it is not a minor one. For each city, they had to know in which direction a point thousands of kilometres away lay, on an Earth known to be round but whose distances were poorly measured.
Two centuries of work before him

The problem did not wait for the eleventh century. Al-Khwarizmi, who died around 850, already addressed it. Habash al-Hasib, active in Baghdad in the middle of the ninth century, was probably the first to solve it by a drawn construction, what is called an analemma: a scale figure from which the required direction is read directly. Al-Battani, who died in 929, and al-Nayrizi, who died around 940, produced methods of their own. Abu al-Wafa, who died in 997 or 998, proved the tangent rule in the geometry of the sphere and applied it to the qibla.
These were not sketches. They were working methods, and they were used. They had only two limits. Some went through drawing, and so through the precision of a hand-drawn figure. Others held for one city, or one region, and had to be started again elsewhere. Two centuries of work, city after city.
The one who went furthest

One man took the further step. His name was al-Hasan ibn al-Haytham, he died in Cairo around 1040, and the history of science knows him mainly for something else: his work on light and vision made him one of the founders of optics, and his Book of Optics circulated in Europe for centuries under the Latin title Opticae Thesaurus.
He also left a treatise whose object is to determine, by calculation, the angle of the qibla. Not for one city. For any point on Earth, from its coordinates alone. It is the first universal solution to the problem, and it is reached by calculation rather than by drawing.
The exact date of writing is not established. All that is known is that it predates his death, which places it before 1040.
And the problem did not stop with him. Work continued for three more centuries. In fourteenth-century Damascus, al-Khalili, timekeeper at the Umayyad Mosque, computed by hand a table of three thousand entries giving the qibla for every degree of latitude and longitude in the Muslim world. From the ninth century to the fourteenth, that is six centuries of work, not two.
Two books by the same man, taken for one
Here is the reversal, and it is not medieval.
Ibn al-Haytham did not write one treatise on the qibla, he wrote two. One solves the problem by calculation, the one just described. The other solves it graphically, by an analemma construction, in the tradition of Habash al-Hasib. Two works, two methods, one author.
Modern historians of science confused the two. And because the universal solution by calculation seemed to appear nowhere earlier, they credited it to a fifteenth-century scholar, Jamshid al-Kashi, active in Samarkand and dead in 1429. Four centuries after Ibn al-Haytham.
Let us be plain: al-Kashi usurped nothing. He was a mathematician of the very first rank, to whom we owe among other things a computation of pi of unprecedented precision. The mistake is not his, it belongs to those who read his manuscripts and not those of Ibn al-Haytham. Nor is it old: it is an error of our own time, corrected in 1995 by the edition and study of the treatise in the journal Arabic Sciences and Philosophy.
What survives in your pocket

The method used today by qibla applications is not Ibn al-Haytham's. They apply the modern great-circle bearing formula, computed on the triangle formed by your position, the North Pole and the Kaaba, from the coordinates your phone's satellite receiver hands them.
But it is the same geometry, that of the sphere, and it is the same problem. What took two centuries of treatises, tables and instruments now fits in a few lines of code and resolves before the screen lights up.
One useful detail if you use these tools: the bearing they display is measured from true north, whereas a compass needle points to magnetic north. The difference is negligible in France, on the order of a degree. It is not negligible everywhere.
What we do not say
We do not claim that Ibn al-Haytham was the greatest contributor to this history. What is established is that he gave the first universal solution by calculation. Ranking scholars separated by two centuries would mean nothing, and would erase the very people this article has just named.
We give no firm date for the writing of his treatise, because the sources give none.
And we do not present the misattribution as an ancient injustice. It is recent, it is the work of modern scholarship, and it was corrected by that same scholarship. That is rather to its credit.
Further reading: episode 1, episode 2, episode 3 and episode 4.