Mapping the Direction to Makkah: A GIS Perspective


This article by Ahmad S. Massasati, Ph.D. with the Department of Geography, United Arab Emirates University looks at the use of GIS to remove confusion about the correct direction to Makkah.  Dr. Massarati create a map showing prayer direction circles and prayer circles (PDC/PC).  

Determination of the direction to Makkah is essential for Muslims around the globe to perform the five time daily prayer. Maps, projected on a flat surface, may give the wrong impression on directions. This paper discusses a cartographic solution to solve this problem by introducing a prayer direction circles and a prayer circles system. The new system was established using a spherical triangulation solution with the city of Makkah at the center of the prayer circles.

The direction from Makkah to Madinah in Saudi Arabia is used as a prime circle for that system. Using automated cartography (or Geographic Information Systems), the directions can be visualized and printed on base maps in various projections. These maps can be used as an effective educational tool to provide a practical guide that eliminates confusion about directions to Makkah.

Map of Prayer Direction Circles/ Prayer Circles




Knowledge of locations and directions using the stars was almost instinctual for Arabs during the pre-Islamic era. Being an illiterate nation, using the pen to record information was very limited and hence the art and science of map making was almost non-existent. It was not until Islam, that the use of the pen became a necessity of everyday life. The importance of keeping written records became evident especially when the Muslim Empire expanded beyond the Arabian Peninsula. In a very short time the Muslims were able to conquer scientifically more advanced nations such as the Byzantine and Persian Empires. Geographical records and maps, inherited from the ancients were translated into the Arabic language and modified to encompass the Islamic vision of the world of geography. Elements of nature such as the wind, the mountains and seas that were previously feared by nations are no longer gods to be worshiped, but rather signs of Allah’s creations to be studied. Geographic information was both descriptive and literal in nature, supported by maps. Mathematical equations that can determine locations of the stars were engraved on mechanical tools such as the Astrolabe. Records of the use of spherical trigonometry in geography can be traced back to the 9th century AD (3rd century of Islam) (Ilyas, 1984) (David 1999).

While Islamic teachings encourage scientific research in general, the second pillar of Islam, that is prayer, demands awareness of time and location. In order to perform the prayer correctly, a person has to pray five times a day, according to specific timings while facing the city of Makkah. The sacred direction towards Makkah (called al-Qibla) also influenced other aspects of the Muslim life such as architecture, and burial rites. The concept of sacred direction was not new; Jews and Christians used Jerusalem as a geographic center for their religion (Harley and Woodward, 1992). During the early revelations of Islam, Muslims used Jerusalem for the same purpose as well. The Islamic teaching later changed the sacred direction to Makkah and made it a condition for correct prayer. This drove the Muslims to a higher level of sophistication in solving the problem of determining directions.

Two major approaches to determine the direction to Makkah can be recognized. The first is the folk astronomy (ethnoastronomy) where the scholars of the sacred law of Islam (fuqaha) has a major influence on interpretation and are related more toward the spiritual aspect of the problems. The second is the mathematical method where a high level of calculations and technical solutions were applied by professional scientists (King, 1999). This paper argues that the gap between the two approaches is not big and there are many historical evidence shows an actual merge of the two approaches. These evidences are found in many maps and calculations of Islamic literatures throughout history. The two Iranian 17th century maps introduced by David A. King (1999) of the Old World (discovered in 1989 and 1995) with Mecca at the center as well as similar found in (Harley and Woods, 1992) are a good example. The Qibla tables and mechanical devices such as the Astrolabe (Harley and Woodward, 1992) are another example. The vast number of Mosques build by early Muslim immigrants in the Americas with the correct direction to Makkah are a very good indication that the difference between the two approaches is minimal and that the confusion over the correct direction is very limited (Ahmad, 1994).

In modern times, with the implementation of computer technology, producing maps in various projections becomes a matter of choice. Once geographic information is recorded in digital form, it is possible to produce maps in any desired projection. While the same technology enhances our geographical knowledge by introducing it in a visual form, for the layman it can be confusing when it comes to directions. Modern maps, made from a western perspective, do not necessarily provide or display information such as, great circles centered on the city of Makkah. For a casual map user, the direction to Makkah from the United States on a Mercator projection map seems to be to the southeast. The confusion extended in some cases to professional geographers of whom when asked for direction to Makkah they used the rhumb line as a solution (Nachef and Kadi, 1993). Part of the problem is due to lack of scientific understanding of the Islamic teaching regarding the prayer direction (Ahmad, 1994, Almakky and Snyder, 1996, and Shaukat 2000).

In a previous paper (Massasati 1994), the author introduced the concept of the prayer circle (PC) and prayer direction circle (PDC) system to help simplify the problem. This paper combines these concepts with spherical triangulation and cartographic design to offer a visual solution to the problem using Geographic Information Systems (GIS).

Prayer circle, Prayer direction circle

To better understand the Islamic perspective of the problem, one has to go to its geographical basis. The Quran is very specific about using the Kabah (the great Mosque in Makkah) as a focal point (Qibla). When Muslim are gathered in Makkah, they pray in a circle around the Kabah. This is called the prayer circle (Massasati, 1994). The circles obviously start small around the cubic structure of the Kabah and grow larger until it constitutes a great circle. The circles then grow smaller again until reaching a point opposite Makkah on the other side of the earth. At that point, a person could perform prayer in any direction. In order for a person to be praying facing the Kabah, the direction of the prayer has to be perpendicular to the prayer circle. Persons standing behind each other are located on a prayer direction circle (Massasati, 1994). This is a great circle formed by the persons and the Kabah. Figure 1 shows the PC/PDC system.

Figure 1. The PC/PDC system (Modified from Massasati, 1994).

Figure 1. The PC/PDC system (Modified from Massasati, 1994).

In order for the PC/PDC system to be presented on a map, in a similar fashion to the graticule system of Latitude and Longitude (Lat/Lon), two reference points on the earth’s surface are needed. Makkah is the primary point, simply because it is the focus point or the point of destination (similar to the North Pole). A secondary point has to be selected to create a prime PDC (similar to Greenwich in England). For this paper, the city of Madinah is selected because it is the second holy city for the Muslim.

Calculation of the PC/PDC

A spherical triangulation solution (Ayres, 1954) has been applied on a ten degree interval PC/PDC system. The vertices of the system are computed using spherical triangulation. In the spherical triangle (Figure 2), C is located at the North Pole, The City of Makkah at B and the calculated vertex is located at A. The first step is to calculate the vertices of the prime PDC. The Lat/Lon of the cities of Makkah and Madinah are 21o 27’N, 39 o 45’E and 24 o 26’N, 39 o 42’E, respectively. Using the following spherical triangulation equations:

Figure 2. The spherical triangle.

Figure 2. The spherical triangle.

tan 0.5 (B + A) = cos 0.5 (b – a) sec 0.5 (b + a) cot 0.5 C

tan 0.5 (B – A) = sin 0.5 (b – a) csc 0.5 (b + a) cot 0.5 C

tan 0.5 c = tan 0.5(b – a) sin 0.5 (B + A) csc 0.5 (B – A)

Where: sec = 1/cos, csc = 1/sin, and cot = 1/tan.

The calculated azimuth from Makkah to Madinah is 0.8745912 Degrees west. Using the Makkah-Madinah prayer direction as a prime PDC, the same equations were used to determine the coordinate of vertices on a great circle by using a ten-degree interval for each calculation. PDCs vertices were calculated by adding intervals of ten degrees to the Makkah-Madinah direction to cover the entire globe. Table 1 shows part of the Lat/Lon calculations of PDC/PC vertices. Each two columns on the table show the calculation of the Lat/Lon of each vertex in decimal degrees.  Lat (0-180) and Lon (0-180) on column one and two are the calculated Lat/Lon for the prime PDC. For the PC circles, the Lat/Lon calculation starts at a PC (180) in the other side of the earth at Lat/Lon –21.45/ –140.25. The calculation reaches PC (0) at the city of Makkah where Lat/Lon is 21.45/39.75. The calculations continue for the other side of the PCs till reaching the anti Makkah point.

 Table 1.  Calculated vertices of the PDC/PC system (part of the full 18×36 matrix).

PDCLat(0-180)Lon(0-180)Lat(10)Lon(10)Lat (170)Lon (170)

Note: All units are in decimal degrees.

The Lat/Lon values are both positive if the point is located Northeast, positive and negative if the point is located Northwest, both negative if the point is located Southwest, and are negative and positive if the point is located Southeast.

Visual Presentation

Once the PC/PDC are recorded in a computer form, presenting the circles on a map is a matter of personal preference and software capabilities. For example, Figure 3 shows the Earth as seen from space using orthographic projection. The true azimuth to Makkah at a given point can be determined as the angle between the geographic meridian and the PDC at that point.

Figure 3. The PC/PDC on the world map as seen from space.

Figure 3. The PC/PDC on the world map as seen from space.

By choosing another map projection, the PC/PDC system can be presented to show the earth from a different perspective. Figure 4 shows a global perspective of the familiar Robinson projected map.

Figure 4. The PC/PDC system displayed on a Robinson projection of the world.

Figure 4. The PC/PDC system displayed on a Robinson projection of the world.

Figure 5 shows a regional perspective of North America with the PC/PDC system on a Miller Cylindrical projection. The map shows very clearly that the direction to Makkah is northeast except for Alaska where the direction to Makkah become due north.

Figure 5. The PC/PDC system on a Miller Cylindrical projection of North America.

Figure 5. The PC/PDC system on a Miller Cylindrical projection of North America.


Present day computer cartography and GIS technology make it possible to make maps that show geographical data from different perspectives. The concept of drawing great circles to show proper directions to airports on maps has been used in present times. Publications and arguments summarized in Nashef and Kadi, (1993) are based on a visual presentation of earth on a flat surface. In that case, information is ‘distorted’ so that the direction to Makkah from the places such as the United States of America (USA) seemed toward the southeast not the northeast. The PC/PDC system, though printed on flat surface, demonstrates very clearly that the correct directions in the USA are toward the northeast.


– Ahmad, Imad-ad-Dean (1994), Review of “The Substantiation of the People of the Truth that the Direction of al-Qiblah in the United States and Canada is to the Southeast,” Islamic Horizons, Islamic Society of North America, September 1994, pp. 41-43.

– Almakky, Ghazy A. and John P. Snyder (1996), Calculating an Azimuth from One Location to Another: A Case Study in Determining the Qibla to Makkah, Cartographica, Volume 33, Number 2, Summer 1996, pp. 29-35.

– Ayres, Frank Jr. (1954), Schaum’s Outline of Theory and Problems of Plane and Spherical Trigonometry, Schaum’s Outline Series, McGraw-Hill Book Company, New York, St. Louis, San Francisco, Toronto, Sydney.

– Harley, J. B. and David Woodward (1992), The History of Cartography, Volume Two, Book One, Cartography in the Traditional Islamic and South Asian Societies, The University of Chicago Press, Chicago & London.

– Ilyas, Mohammad (1984), A Modern Guide to Astronomical Calculations of Islamic Calendar, Times & Qibla, Berita Publishing Sdn Bhd, Kuala Lumpur 22-03.

– King, David A (1999), World-maps for Finding the Direction and Distance to Mecca: Innovation and Tradition in Islamic Science, London, Al-Furqan Islamic Heritage Foundation.

– Massasati, Ahmad S. (1994), The Direction to Makkah, Islamic Horizons, Islamic Society of North America, September 1994, pp. 36-38.

– Nachef, Riad and Samir Kadi (1993), The Substantiation of the People of the Truth that the Direction of al-Qiblah in the United States and Canada is to the Southeast, Association of Islamic Charitable Projects, Philadelphia, 1993.

– Shaukat, Khalid S., Where is the Qibla from North America, Islamic Horizons, Islamic Society of North America, July/August 2000, pp. 60.


Like this article and want more?

Enter your email to receive the weekly GIS Lounge newsletter: