The Analysis and Implementation of Haversine Formulas in 
Determining Qibla Direction by using Sphiral Trigonometry in 
Indonesia 
Binti Maftukhah
1
, Nurissaidah Ulinnuha
1
, Mohammad Hafiyussholeh
1
 
and
 
Wika Dianita Utami
1
 
1
Department of Mathematic, Sunan Ampel University, Jl. Ahmad Yani 117, Surabaya, Indonesia
 
Keywords: Qibla Direction, Haversine Formula, Sphiral Trigonometry. 
Abstract:  Muslims are fully obliged to pray five times a day. In carrying out this obligation, facing qibla is a one of the 
requirements of a valid prayer. However, there are no specific provisions set out in the Qur'an or Hadith which 
explicitly governs the direction of qibla for each inhabited area. The purpose of this research is to compile 
and obtain derivations of the haversine formula for calculating the qibla direction which is applied from the 
locations of Jakarta, Surabaya, and Makassar. The results show that by descending definitions of haversine, 
rules of cosine in spherical triangles, addition and multiplication rules on trigonometry and the circumference 
of the spherical triangle, the qibla direction formula from a location at point B is 
   
.  
is the coordinate point of the calculated location,  is side length ,   is side length , and  is the 
circumference of the spherical triangle. Results of the implementation of qibla direction for the three cities of 
Jakarta, Surabaya, and Makassar were 65°42
31.27′′,65°29
10.89′′,and66°51
53.67′′, respectively. 
1 INTRODUCTION 
Mathematics is understood to be an abstract and 
theoretical science. Most people consider it as only 
containing formulas and is far away and not 
intersecting with the reality of life. On the other hand, 
mathematics is the basis of science development (basic 
of science) and is known as the mother of science 
because of its various uses. Mathematics also has an 
important role in worship, as in the case of prayer. 
An example of the application of mathematics 
that relates to prayer is the  determination of prayer 
times and  the direction for qibla. Muslims are obliged 
to pray five times a day. When carrying out this 
obligation, facing qibla is required as a legal 
requirement of prayer. In the al-Qur'an, the verses 
relating to qibla are repeated four times, one being 
QS. Al-Baqarah (2) verse144. 
Based on this verse (QS. Al- Baqarah verse 114), 
Muslims only obtain a general provision to perform 
prayers and that everyone must face qibla. However, 
no specific provisions are arranged in the al-Qur'an or 
Hadith that explicitly regulates the direction of qibla 
for each inhabited area. Therefore, a certain method 
is needed to determine the direction of qibla as 
referred in the al-Qur'an.
 
Muftis and Muslim scholars have conducted 
particular research related to the determination of the 
qibla direction as the prayer direction of Muslims in 
Indonesia. Research was carried out by the 
Indonesian Mufti Council (known as MUI), the 
results of the formulation and its provisions was 
formulated as a fatwa (instructions for Muslims). 
Precisely in 2010, a fatwa was conveyed to the public 
stating that the location of qibla was east of Makkah, 
which is located west of Indonesia. The provisions 
that were originally expected to facilitate, enlighten, 
and unite understanding of the people immediately 
was changed based on facts in the field that the 
formula caused a number of new problems. Some 
Muslim communities considered the MUI's fatwa on 
the determination of qibla direction had ruled out the 
development of modern technology and science. This 
was due to the scope of the territory of Indonesia 
which is very broad, so the determination of the 
direction of qibla cannot only be based on one 
particular location. As a response to this matter, MUI 
made a fatwa revision for the direction of qibla for 
Muslims in Indonesia, which previously was 
explained as to only face westward, which was 
subsequently changed to northwest with varying 
positions based on the location of each region. 
Maftukhah, B., Ulinnuha, N., Hafiyusholeh, M. and Utami, W.