Skip to main content Accessibility help
Hostname: page-component-55597f9d44-5zjcf Total loading time: 0.473 Render date: 2022-08-18T20:15:54.570Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "useRatesEcommerce": false, "useNewApi": true } hasContentIssue true

Ibn al-Haytham's Universal Solution for Finding the Direction of the Qibla by Calculation

Published online by Cambridge University Press:  24 October 2008

Ahmad S. Dallal
Department of Near Eastern Languages and Civilizations, Yale University, New Haven, CT 06520, U.S.A.


This paper presents an edition of al-Hasan ibn al-Ḥasan ibn al-Haytham's (d. 1040) treatise, Qawl fi samt al-qibla bi-al-ḥisāb (on finding the azimuth of the Qibla by calculation) with translation and commentary. In it Ibn al-Haytham provides a universal method for finding the direction of the qibla at any location on the surface of the earth by using spherical trigonometry and accurate calculation. Ibn al-Haytham's computational solution has not been studied before, and it has often been confused with another work of his in which he uses an analemma construction to solve the problem of the qibla graphically. As a result of this confusion, contemporary scholars have mistakenly attributed the first universal solution of the qibla problem to Jamshīd al-Kāshī (15th century), some four centuries after the introduction of this method by Ibn al-Haytham. The present treatise represents an important juncture in the history of the development of mathematics of the qibla, and sheds more light on the contributions of one of the most important scientists of medieval Islam.

Dans cet article, on présente une édition, une traduction et un commentaire d'un traité d'al-Ḥasan ibn al-Ḥasan ibn al-Haytham (m. 1040), dont l'objet est de déterminer, par le calcul, l'azimuth de la qibla. Ibn al-Haytham y propose une méthode universelle pour trouver la direction de la qibla, en n'importe quel emplacement sur la surface de la terre, en utilisant la trigonométrie sphérique et le calcul exact. La solution par calcul d'lbn al-Haytham n'a pas été étudiée auparavant et le présent traité a souvent été confondu avec une autre oeuvre d'Ibn al-Haytham, dans laquelle ce dernier utilise une construction par analemme pour résoudre le même probléme. Cette confusion a eu pour effet de conduire les chercheurs modernes á attribuer, á tort, la première solution universelle du probléme de la qibla à Jamshīd al-Kāshī (XVe siècle), solution conçue quelque quatre siècles après la méthode introduite par Ibn al-Haytham. Le présent traité d'Ibn al-Haytham est ainsi remarquable pour deux raisons: il représente un jalon important dans l'histoire du développement des méthodes mathématiques pour résoudre le problème de la qibla, et il jette des lumières nouvelles sur la contribution de l'un des plus grands savants de I'Islam médiéval.

Research Article
Copyright © Cambridge University Press 1995

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)


1 On the life and work of Ibn al-Haytham see the latest analysis in Rashed, R., Les mathématiques inflnitésimales du IXe au XIe siècle. Vol II: Ibn al-Haytham (London, 1993).Google Scholar In the introduction to this work, Rashed resolves a long standing ambiguity in the biographical studies on Ibn al-Haytham, and proves that there are in fact two historical figures by this name; these are al-Ḥasan ibn al-Hasan, and Muhammad ibn alHasan. The former is the most famous of the two, and is the author of the work studied here, while the later is a philosopher and physician. For an earlier account of Ibn al-Haytham's life and work see Sabra, A. I., “Ibn al-Haytham,” Dictionaiy of Scientific Biography, 18 vols. (New York, 19701990), vol. 6 (1972), pp. 189210.Google Scholar For lists of his works and available manuscripts, see Sezgin, F., Geschichte des arabischen Schrifttums, 9 vols. (Leiden, 1967 Onwards), especiallyGoogle Scholar Band V, Mathematik (1974), pp. 358–73Google Scholar, and Band VI (1978),Google Scholar Astronomie, pp. 251–61.Google Scholar

2 On the sacred direction see King, D. A., “Kibla,” Encyclopaedia of Islam, second edition, 6 vols. to date (Leiden, 1960 to present) vol. V, pp. 82–8.Google Scholar See also King, D. A., “The sacred direction in Islam: A study of the interaction of religion and science in the Middle Ages,” Interdisciplinary Science Reviews, 10 (1985): 315–28.CrossRefGoogle Scholar

3 On the standard approximation method of al-Battānī see King, “Kibla,” p. 84; also see King, D., “Al-Khalīlī's qibla table,” Journal of Near Eastern Studies, 34.2 (1975): 81–121, p. 82.Google Scholar For discussion of three approximate computational methods and one approximate cartographic construction see King, D., “The earliest Islamic mathematical methods and tables for finding the direction of Mecca,” Zeitschrift fur Geschichte der Arabisch-Islamischen Wissenschaften, 1 (1986): 97109.Google Scholar For tables based on approximate methods see King, “Al-Khalīlī's qibla table,” pp. 120–2, and King, “Earliest,” pp. 108–12.

4 For exact solutions of the problem of the qibla using rectilinear configurations inside the sphere see Ali, J., The Determination of the Coordinates of Cities: al-Bīrūnī's Taḥdīd al-Amākin (Beirut, 1967), pp. 243–52;Google Scholar Kennedy, E. S., A Commentary upon al-Bīrūnī's Kitāb Taḥdīd al-Amākin (Beirut, 1973), pp. 202–9;Google Scholar and King, “Earliest,” pp. 112–15.

5 On different analemmas used for solving the qibla problem see Kennedy, E. S. and Id, Y., “A letter of al-Bīrūnī: Ḥabash al-Ḥāsib's analemma for the qibla,” in Kennedy, E. S., Colleagues and Former Students, Studies in the Islamic Exact Sciences (Beirut, 1983), pp. 621–9;Google Scholar Ali, Bīrūnī's Taḥdīd, pp. 255–6;Google Scholar Kennedy, Commentary upon al-Bīrūnī's Tahdīd, pp. 209–11;Google Scholar For a comparison of four analemmas including, in addition to the above two by Habash and Bīrūnī, one analemma from Bīrūnī's Al-Qānūn al-Mas'ūdī and one by Ibn al-Haytham see Berggren, J. L., “A comparison of four analemmas for determining the azimuth of the qibla”, Journal of the History of Arabic Science, 4 (1980): 6980.Google Scholar Also, on the analemmas of Habash and Ibn al-Haytham, see King, “Kibla,” p. 85, and King, “Earliest,” pp. 115–18.Google Scholar For tables based on analemmas see King, “Kibla,” p. 87, and King, “Al-Khalīhī's qibla table” pp. 101–8, 110–11.Google Scholar

6 For spherical trigonometric methods see Bīrūnī's first and fifth methods in Ali, Bīrūnī's Tahdīd, pp. 241–3, 252–5,Google Scholar and Kennedy, Commentary upon al-Bīrūnī's Taḥdīd, pp. 198–200, 211–14.Google Scholar For a comparison and discussion of the development of such methods in the works of Habash al-Hāsib (9th century), Ibn Yūnus, Abū al-Wafā' al-Buzjānī, al-Qūhī, Kushyār ibn Labbān, al-Bīrūnī, and the anonymous author of the Zij al-Shāmil (10th and 11th centuries), and Jamshīd al-Kāshī (15th century), see Berggren, J. L., “On al-Bīrūnī's ‘Method of the zijes’ for the qibla,” Proceedings of the 16th International Congress for the History of Science (Bucharest, 1981), pp. 237–45Google Scholar, and Berggren, J. L., “The origins of al-Biruni's ‘Method of the Zijes' in the theory of sundials,” Centaurus, 28 (1985): 116.CrossRefGoogle Scholar Also on the methods of al-Bīrūnī and al Nayrīzī see King, “Kibla,” pp. 85–6.Google Scholar For the earliest exact method using spherical trigonometry see King, “Earliest,” pp. 115–18. For tables based on such methods see King, “Kibla,” pp. 87–8; King, “Earliest,” pp. 118–29; and King, “Al-Khalīlī's qibla table.”

7 See, in addition to references listed in the above footnotes, King, “Earliest,” pp. 130–41. It should be noted that the working inside the sphere, analemmas, and work on the surface of the sphere all started in Hellenistic times, but these methods were greatly augmented in the Islamic Middle Ages.Google Scholar

8 For a list of available manuscripts see Sezgin, Geschichte, Band V, # 15, p. 368Google Scholar, and Band VI, # 18, p. 259. Also for a reference to this treatise see Sabra, “Ibn al-Haytham,” p. 205.Google Scholar

9 For a list of available manuscripts see Sezgin, , Geschichte, Band V, # 16, p. 368, and Band VI, # 19, p. 259.Google Scholar

10 For an edition of Ibn al-Haytham's autobiography see Heinen, Anton, “Ibn Al-Haytams Autobiographie In Einer Handschrift Aus Dem Jahr 556 H./1161 A.D.,” Die islamische Welt zwischen Mittelalter und Neuzeit: Festschrift fur Hans Robert Roemer zum 65. Geburtstag (Beirut, 1979), pp. 254–77. For a reference to the third treatise see p. 263 of the autobiography. For the second treatise see p. 276.Google Scholar

11 See footnotes 3–7 above.Google Scholar

12 See King, “The sacred direction,” p. 317, and King, “Earliest,” p. 116.Google Scholar

13 See Schoy, C., “Abhandlung des al-Hasan ibn al-Hasan ibn al-Haitam (Alhazen) uber die Bestimmung der Richtung der Qibla,” Zeitschrift der Deutschen Morgenlandischen Gesellschaft, 75 (1921), pp. 242–53.Google Scholar Also see Schoy, C., “Kibla,” Encyclopaedia of Islam, first edition, 4 vols. (Leiden, 19131934) vol. II, pp. 988–9.Google Scholar

14 See Sabra, “Ibn al-Haytham,” p. 205.Google Scholar

15 See Schoy, “Abhandlung,” p. 244.Google Scholar

16 For a catalogue reference to this manuscript see King, D. A., A Catalogue of The Scientific Manuscripts in the Egyptian National Library (in Arabic), (Cairo, 1981), p. 317.Google Scholar Also see King, D. A., A Survey of the Scientific Manuscripts in the Egyptian National Library (Malibu, Ca., 1985), # B.77-(3.3.1).Google Scholar On Qādīzādeh see Dilgan, Hamit, Dictionary of Scientific Biography, vol. 11 (1975), pp. 227–9.Google Scholar

17 Ibn al-Sarrāj is quoted in King, “Sacred direction,” p. 317.Google Scholar The text, taken from MS Dublin Chester Beatty 4833, reads: “Laqad abda'a Abū al-Ḥasan ibn al-Ḥasan ibn al-Haytham fi taḥrīr hādhihi al-mas'ala idh ṣawwarahā fi yā' wāw (16) shaklan mubarhanan.” On Ibn al-Sarrāj see King, Survey, # C26.Google Scholar

18 See Berggren, “Bīrūnī's ‘Method’” pp. 237–-45, and Berggren, “Origins,” pp. 1–16.Google Scholar

19 On On al-Bīrūnī see Kennedy, E. S., “Al-Bīrūinī”, Dictionary of Scientific Biography, Vol. 2 (1970), pp. 147–58.Google Scholar

20 On al-Qūhī see Dold-Samplonius, Y., “Al-Qūhī”, Dictionary of Scientific Biography, vol 11, (1975), pp. 239–41.Google Scholar

21 On Abū al-Wafā'Google Scholar, see Youschkevitch, A. P., “Abū al-Wafā' al-Būzjānī,’, Dictionary of Scientific Biography, vol. 1 (1970), pp. 3943.Google Scholar

22 On Kushāyr see Saidan, A. S., “Kushyār ibn Labbān’, Dictionary of Scientific Biography, vol 7 (1973), pp. 531–3.Google Scholar

23 On this and other zījes see Kennedy, K. S., “A survey of Islamic astronomical tables”, Transactions of the American Philosophical Society, 46 (1956): 123–77.CrossRefGoogle Scholar

24 On al-Kārūnī see Youschkevitch, A. P. and Rosenfeld, B. A., “Al-Kāshī”, Dictionary of scientific Biography, vol 7 (1973), pp. 255–62.Google Scholar

25 For example, Bīrūnī Proposes in his al-Qānūn al-Mas 'ūdī a refind computational method in which he uses the rule of foue quantities, and the law of since for spherical triangles instead of the cumbersome application of the theorem of Menelaos.Google Scholar See King, “Kibla”, p. 86, and Berggren, “Origins”, pp. 14–15. On the rule of four and other developments in Islamic trigonometry see Kennedy, “The history of trigonometry”Google Scholar, in Kennedy, colleagues and students, Studies in the Islamic Exact sciences. pp. 3–29.Google Scholar

26 See Berggren, “Origins”, p. 16.Google Scholar

27 See Berggren, “Birūnī's ‘Method’,” p. 245Google Scholar, and Berggren, “Origins”, pp. 5–6, 8–9.Google Scholar

28 See Berggren, “Origins”, p. 16.Google Scholar

29 For the earlist extant method where the arcs are called “the first quantity”, etc., see King, “Earlist”, pp. 112–15.Google Scholar

30 See Berggren, “Origins”, pp. 11–14.Google Scholar

31 See King, “Earlist”, p. 117.Google Scholar

32 On Bīrūnī's methods see footnotes 4–6 above.Google Scholar

33 On the use of base 60 see Kennedy, “The history of trigonometry”, pp. 3–29;Google Scholar also on the use of R see Neugebaure, Otto, A History of Ancient Mathematical Astronomy. 3 vols. (New York, 1975), part 3, pp. 1115–6.CrossRefGoogle Scholar

34 On the Menelaos theorem see Neugebaure, A History of Ancient Mathematical Astronomy, Part 1, pp. 26–9;Google Scholar also see Kennedy, “The history of trigonometry”, pp. 12–15.Google Scholar

35 On the use of armillary sphere see Kennedy, E. S., “AL-Kāshī's treatise on astronomical observational instruments,” in Kennedy et al, Studies in the Islamic Exact Sciences, pp. 394–404.Google Scholar

* The author would like to express his gratitude to professor F. Sezgin for supplying related material which was of use during the study, and to professor E. S. Kennedy and G. Saliba, who read this paper and made valuable comments on it. Special thanks go to Professor D. A. King who familiarized me with the topic in the first place, supplied copies of the Cairo, and Berlin manuscripts, and guided me through the study. The author remains, however, solely responsible for any errors that may appear in this paper.Google Scholar

Cited by

Save article to Kindle

To save this article to your Kindle, first ensure is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the or variations. ‘’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Ibn al-Haytham's Universal Solution for Finding the Direction of the Qibla by Calculation
Available formats

Save article to Dropbox

To save this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you used this feature, you will be asked to authorise Cambridge Core to connect with your Dropbox account. Find out more about saving content to Dropbox.

Ibn al-Haytham's Universal Solution for Finding the Direction of the Qibla by Calculation
Available formats

Save article to Google Drive

To save this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you used this feature, you will be asked to authorise Cambridge Core to connect with your Google Drive account. Find out more about saving content to Google Drive.

Ibn al-Haytham's Universal Solution for Finding the Direction of the Qibla by Calculation
Available formats

Reply to: Submit a response

Please enter your response.

Your details

Please enter a valid email address.

Conflicting interests

Do you have any conflicting interests? *