Theoretical basis: the great circle A
great circle, also called the orthodrome, is any circle on a sphere whose centre is identical to the centre of the sphere. For example, all lines of
longitude are great circles of the Earth, while the
equator is the only line of
latitude that is also a great circle (other lines of latitude are centered north or south of the centre of the Earth). The great circle is the theoretical basis in most models that seek to mathematically determine the direction of the qibla from a locality. In such models, the qibla is defined as the direction of the great circle passing through the locality and the Kaaba. One of the properties of a great circle is that it indicates the shortest path connecting any pair of points along the circle—this is the basis of its use to determine the qibla. The great circle is similarly used to find the shortest flight path connecting the two locations—therefore the qibla calculated using the great circle method is generally close to the direction of the locality to Mecca. As the
ellipsoid is a more accurate
figure of the Earth than a perfect sphere, modern researchers have looked into using ellipsoidal models to calculate the qibla, replacing the great circle by the
geodesics on an ellipsoid. This results in more complicated calculations, while the improvement in accuracy falls well within the typical precision of the setting out of a mosque or the placement of a mat. For example, calculations using the
GRS 80 ellipsoidal model yields the qibla of 18°47′06″ for a location in
San Francisco, while the great circle method yields 18°51′05″.
Calculations with spherical trigonometry The great circle model is applied to calculate the qibla using
spherical trigonometry—a branch of
geometry that deals with the mathematical relations between the sides and angles of triangles formed by three great circles of a sphere (as opposed to the conventional
trigonometry which deals with those of a two-dimensional triangle). , Indonesia, can be calculated as follows. The city's coordinates, \phi, are 7.801389°S, 110.364444°E, while the Kaaba's coordinates, \phi_Q, are 21.422478°N, 39.825183°E. The longitude difference \Delta L is (110.364444 minus 39.825183) 70.539261. Substituting the values into the obtains an answer of approximately 295°, or 25° north of west. If a location O, the Kaaba Q, and the north pole N form a triangle on the sphere of the Earth, then the qibla is indicated by OQ, which is the direction of the great circle passing through both O and Q. The qibla can also be expressed as an angle, \angle NOQ (or \angle q), of the qibla with respect to the north, also called the
inhiraf al-qibla. This angle can be calculated as a mathematical function of the local latitude \phi, the latitude of the Kaaba \phi_Q, and the longitude difference between the locality and the Kaaba \Delta L. This function is derived from the
cotangent rule which applies to any spherical triangle with angles A, B, C and sides a, b, c: Applying this formula in the spherical triangle \triangle NOQ (substituting B = \angle q = \angle NOQ) and applying
trigonometric identities obtain: {{NumBlk|:|\tan q = \frac{\sin \phi \cos \Delta L - \cos \phi \tan \phi_Q}{\sin \Delta L}, or|}} {{NumBlk|:|q = \arctan \left( \frac{\sin \phi \cos \Delta L - \cos \phi \tan \phi_Q}{\sin \Delta L}\right)|}} This formula was derived by modern scholars, but equivalent methods have been known to Muslim astronomers since the 9th century (3rd century ), developed by various scholars, including
Habash al-Hasib (active in
Damascus and
Baghdad ),
Al-Nayrizi (Baghdad, ),
Ibn Yunus (10th–11th century),
Ibn al-Haytham (11th century), and
Al-Biruni (11th century). Today spherical trigonometry also underlies nearly all applications or websites which calculate the qibla. When the qibla angle with respect to the north, \angle q, is known,
true north needs to be known to find the qibla in practice. Common practical methods to find it include the observation of the shadow at the
culmination of the sun—when the sun crosses exactly the
local meridian. At this point, any vertical object would cast a shadow oriented in the north–south direction. The result of this observation is very accurate, but it requires an accurate determination of the local time of culmination as well as making the correct observation at that exact moment. Another common method is using the compass, which is more practical because it can be done at any time; the disadvantage is that the north indicated by a magnetic compass differs from true north. This
magnetic declination can measure up to 20°, which can vary in different places on Earth and
changes over time.
Shadow observation As observed from Earth, the Sun appears to "
shift" between the
Northern and
Southern Tropics seasonally; additionally, it
appears to move from east to west daily as a consequence of the Earth's rotation. The combination of these two apparent motions means that every day the Sun crosses the meridian once, usually not precisely overhead but to the north or to the south of the observer. In locations between the two tropics—latitudes lower than 23.5° north or south—at certain moments of the year (usually twice a year) the Sun passes almost directly overhead. This happens when the Sun crosses the meridian while being at the local latitude at the same time. The city of Mecca is among the places where this occurs, due to its location at 21°25′ N. It occurs twice a year, firstly on 27/28 May at about 12:18
Saudi Arabia Standard Time (SAST) or 09:18 UTC, and secondly on 15/16 July at 12:27 SAST (09:27 UTC). As the sun reaches the
zenith of the Kaaba, any vertical object on earth that receives sunlight cast a shadow that indicates the qibla (
see picture). This method of finding the qibla is called ("observing the qibla"). Since night falls on the hemisphere opposite of the Kaaba, half the locations on Earth (including Australia as well as most of the Americas and the Pacific Ocean) cannot observe this directly. Instead, such places observe the opposite phenomenon when the Sun passes above the
antipodal point of the Kaaba (in other words, the Sun passes directly underneath the Kaaba), causing shadows in the opposite direction from those observed during '
. This occurs twice a year, on 14 January 00:30 SAST (21:30 UTC the previous day) and 29 November 00:09 SAST (21:09 UTC the previous day). Observations made within five minutes of the ' moments or its antipodal counterparts, or at the same time of the day two days before or after each event, still show accurate directions with negligible difference.
On the world map centered on Mecca. Unlike most map projections, it preserves the direction from any other point on the map to the centre. Spherical trigonometry provides the shortest path from any point on Earth to the Kaaba, even though the indicated direction might seem counterintuitive when imagined on a flat
world map. For example, the qibla from
Alaska obtained through spherical trigonometry is almost due north. This apparent counter-intuitiveness is caused by
projections used by world maps, which by necessity distort the surface of the Earth. A straight line shown by the world map in using the
Mercator projection is called the
rhumb line or the loxodrome, which is used to indicate the qibla by a minority of Muslims. It can result in a dramatic difference in some places; for example, in some parts of North America the flat map shows Mecca in the southeast while the great circle calculation shows it to the northeast. In Japan the map shows it to the southwest, while the great circle shows it to the northwest. The majority of Muslims, however, follow the great circle method. A
retroazimuthal projection is any map projection which preserves the angular direction (the
azimuth) of the great circle path from any point of the map to a point selected as the centre of the map. The initial purpose of its development was to help finding the qibla, by choosing the Kaaba as the centre point. The earliest surviving works using this projection were two astrolabe-shaped brass instruments created in 18th-century Iran. They contain grids covering locations between Spain and China, label the locations of major cities along with their names, but do not show any coastline. The first of the two was discovered in 1989; its diameter is and it has a ruler with which one can read the direction of Mecca from the markings on the instrument's circumference, and the distance to Mecca from the markings on the ruler. Only the second one is signed by its creator, Muhammad Husayn. The first formal design of a retroazimuthal projection in the Western literature is the
Craig projection or the Mecca projection, created by the Scottish mathematician
James Ireland Craig, who worked at the Survey Department of Egypt, in 1910. His map is centered in Mecca and its range is limited to show the predominantly Muslim lands. Extending the map further than 90° in longitude from the centre will result in crowding and overlaps.
Traditional methods Historical records and surviving old mosques show that throughout history the qibla was often determined by simple methods based on tradition or "folk science" not based on mathematical astronomy. Some early Muslims used due south everywhere as the qibla, literally following Muhammad's instruction to face south while he was in Medina (Mecca is due south of Medina). Some mosques as far away as al-Andalus to the west and Central Asia to the east face south, even though Mecca is nowhere near that direction. In various places, there are also the "qiblas of the companions" (), those which were used there by the
Companions of the Prophet—the first generation of Muslims, who are considered role models in Islam. Such directions were used by some Muslims in the following centuries, side by side with other directions, even after Muslim astronomers used calculations to find more accurate directions to Mecca. Among the directions described as the qiblas of the companions are due south in Syria and Palestine, the direction of the winter sunrise in Egypt, and the direction of the winter sunset in Iraq. The direction of the winter sunrise and sunset are also traditionally favoured because they are parallel to the walls of the Kaaba. == Development of methods ==