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.
268
Maftukhah, B., Ulinnuha, N., Hafiyusholeh, M. and Utami, W.
The Analysis and Implementation of Haversine Formulas in Determining Qibla Direction by Using Sphiral Trigonometry in Indonesia.
DOI: 10.5220/0008906200002481
In Proceedings of the Built Environment, Science and Technology International Conference (BEST ICON 2018), pages 268-271
ISBN: 978-989-758-414-5
Copyright
c
2022 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved
The determination of the direction of qibla basically
discusses the calculation of the direction of two points,
from one particular location to the Kabah. Therefore, a
certain method was needed to help determine the
direction of qibla that was scientifically correct and not
just from estimation as had previously been done. A
scientific method in mathematics that can be used to help
determine the direction of qibla is trigonometry.
Trigonometry is a branch of mathematics that studies
triangles and its constituent components, including the
sides and angles of a triangle.
There have been several studies related to the
determination of qibla direction, including by Solikin
(2013) who conducted research by using four
methods: the sinus cosine formula, auxiliary angle,
analoginapier and haversine. The results of the study
explained the comparison between the four methods
and concluded that the haversine method resulted in
more accurate results in the form of coordinate
numbers. Another study by Miswanto (2015)
discussed the implementation of determining qibla
direction by using the haversine method. In these
studies, more emphasis was placed on the
implementation aspects of the calculation for
determination of qibla direction from the formula
provided by Miswanto.
Based on the background of the problem above,
this paper discusses the application of mathematics in
sphiral trigonometry and coordinate systems in
determining the direction of qibla in Indonesia, which
aims to understand how the process of calculating the
direction of qibla is founded.
2 LITERATURE REVIEW
2.1 Qibla Direction
Qibla direction can be determined from any point or
place on the surface of the earth by performing
calculations and measurements. Therefore, the
calculation of qibla direction is basically calculating
which direction the Kabah in Mecca is seen from a
location on the surface on the earth. All movements
of people who are praying - whether during standing,
bowing, or prostrating – will always coincide to the
direction of the Kabah.
2.2 Sphiral Trigonometry
Ball geometry is also called sphiral trigonometry. The
basic principles and concepts of ball geometry that
exist can be applied to solve problems such as
difficulties in calculating and determining the direction
of qibla that applies the rules of spherical triangles.
The rules of the spherical triangle are explained from
non-euclid geometry. Non-euclid geometry is one of
two specific geometries that is obtained by eliminating
the Euclidean parallel postulates, namely the hyperbolic
and elliptic geometries. For historical reasons, this term
has a much narrower meaning in mathematics that is
does in general English. There are many geometries that
do not include Euclidean geometry, but only two are
referred as non-Euclidean geometries.
The view that appears on the surface of the sky
and the earth is in the shape of a ball. Because the
earth is predicted to have a round shape, a triangle
can be obtained on the surface of the ball.
The haversine formula is defined as follows:
(Solikin, 2013)

1 cos (1)
3 RESEARCH METHOD
3.1 Data
The coordinate data points of the cities in Indonesia that
implemented the haversine formula were taken from the
Der Gehele Aarde Atlas by PR. JF boss. Niermeyer, JB.
Wolters - Groningen. In this paper, the coordinate data
points of Jakarta, Surabaya and Makassar were taken as
a sample to calculate the qibla direction.
3.2 Data Analysis
Data analysis was carried out by describing various
mathematics concepts in order to obtain the formula
for determining the direction of qibla, which was then
applied to calculate the direction of the qibla in large
cities. The steps undertaken to achieve the goal of the
research is explained in the following flowcharts in
Figure 1:
Figure 1: Research flowchart.
The Analysis and Implementation of Haversine Formulas in Determining Qibla Direction by Using Sphiral Trigonometry in Indonesia
269
Two main processes were carried out in this
research to analyze data and obtain results in
calculations. The first process was data collection by
reviewing appropriate research literature such as
books, articles, journals, and previous studies. The
second process was calculation of the haversine
formula to determine the direction of qibla.
4 RESULTS DAN DISCUSSION
4.1 Analysis of the Haversine Formula
Haversine is denoted by "" and is defined by

1 cos (1)
Figure 1 shows that β is the angle formed from the
sides of and , while the side located in front of
point has a length . Based on this definition, the
following was obtained:
cos 1 2 (2)
By observing Figure 1, the size of  and
is the point with the angle, hence it can be written
as:
cos 1 2 (3)
Based on the equation of sine and cosine in
spherical trigonometry, the  
 equation was obtained, so
Equation (4) was obtained by observing the preceding
equations.
1 2 cos cos sin sin
sin sin  (4)
Figure 2: Spot coordinate location.
Because of the cos cos cos
sin sin cos then
1 2 cos 2 sin sin  (5)
Based on Equation (4), Equation (5) becomes:
1 2 cos 2 sin sin 
 

sin sin  (6)
The calculation of the qibla direction in a place at
point is explained in Figure 3, as follows:
Figure 3: Quantification of location city.
There are three points in Figure 3, namely, ,
and ., , and each representing the location of
the Kabah, the location where the direction of qibla
will be measured, and the pole of the earth. The
Kabah and the location to be measured in this case are
at a certain latitude () and longitude (), denoted by
,
,
, dan
On the ABC spherical triangle in Figure 3, the
corresponding sides appear as a, b, and c. The length
of each side of the ball triangle, based on
mathematical calculations can be determined by the
formula:
90°
90°
The value of C is the longitude difference between
two locations. In Indonesia the value of C is
mathematically written as the difference in longitude
with the longitude of the Kabah, which is:

.
The value of depends on the position of the place to
be measured, as follows (Hambali, 2015). It is noted
that the value of 

is obtained as:
sin sin 
cos cos (7)
Equation (7) supposes that   and  ,
Equation (7) can then be written


.
Furthermore, trigonometry is defined in the sum
formula by multiplying that  
2



then Equation (7) can be
written as:
sinsin
 
  (8)
BEST ICON 2018 - Built Environment, Science and Technology International Conference 2018
270
Furthermore, as previously stated, 
and , it was obtained:
sin sin  

 (9)
By observing , where is the circumference of
the triangle value 

, then the value
2   , so that it is obtained:
222 (10)
222 (11)
With the example of the value, the equation (11)
becomes  
. Then we have,


 
(12)
The last equation is the equation used as the
calculation of the qibla direction in a place at point B.
4.2 Implementation of the Haversine
Formula
The results of accounting of qibla direction from the
three cities were: Jakarta 65°42
31.27′′, Surabaya
65°29
10.89′′, dan Makassar 66°51
53.67′′.
The qibla direction was compared to the results of
determination calculated by Sriyatin Shadiq Al-
Falaky, which has been copied by the Rukyat
Reckoning Education and Training in East Java. The
two methods have slightly different results because
the two differs in determining the starting point of the
coordinates of each location by only a few degrees.
5 CONCLUSIONS
Based on the discussion, the conclusion to the
calculation of the qibla direction from a place at point
was the use of the equation 

 
. Steps were carried out by deriving
from the definition, the cosine rules on spherical
triangles, addition and multiplication in trigonometry
and circumference of the spherical triangle.
REFERENCES
Ensiklopedi Islam. (2005). Jakarta: PT.Ichtiar Baru Van
Hoeve.
Kamus Ilmu Falak. (2005). Yogyakarta: Buana Puastaka.
Agama, K. N. (n.d.). Al-Qur'an dan terjemahannya.
Bandung: Jumadil 'Ali-art.
Anugraha, R. (2012). Mekanika Benda Langit. Yogyakarta:
Universitas Gajah Mada.
Ayuasnantia. (n.d.). Area Matematika Ssejarah Matematika.
Retrieved from
http://ayuasnantia.student.umm.ac.id/artikel-pendidikan/
Chopde, N. R. (2013). Landmark Based Shortest Path
Detection by Using A* and Haversine Formula,”
International Journal of Innovative Research in
Computer and Communication Engineering.
International Journal of Innovative Research in
Computer and Communication Engineering, halaman
298-302.
Dillon, V. (n.d.). Spherical Trigonometry. Retrieved from
http://www.shef.ac.uk/uni/academi/N-
Q/phys/people/vdhillon/teching/phy105_sphergeon.ht
ml
Hambali, S. (2011). Ilmu Falak. Semarang: IAIN
Walinsongo.
Harahap, N. (2005). Ensiklopedi Matematika. Bandung:
Galia Indonesia.
Izzudin, A. (2012). Kajian Terhadap Metode-Metode
Penentuan Arah Kiblat dan Akurasinya. Jakarta:
Kementrian Agama RI.
Jamil, A. (2009). Ilmu falak Teori dan Aplikasi. Jakarta:
Hamzah.
Khazin, M. (2005). Ilmu Falak Dalam Teori dan Praktik.
Yogyakarta: Buana Pustaka.
Kusdiono. (2002). Ilmu Ukur Segitiga Bola. Bandung: ITB
Bandung.
Maskufah. (2009). Ilmu Falak. Jakarta: Gaung Persada
Ekpres.
Murray, D. (n.d.). Spherical Trigonometry. New York:
Logmens Green And Co.
Murtadho, M. (2008). Ilmu Falak Praktis. Malang: UIN
Malik Ibrahim.
Prasetyo, D. (2015). Penerapan Haversine Formula Pada
Aplikasi Pencarian Lokasidan Informasi Gereja Kristen
di Semarang.
Solikin, A. (2013). Perhitungan Kiblat Menurut Susiknan
Azhari. Semarang: UIN Walisongo.
Sudibyo, M. (2011). Sang Nabi Pun Berputar. Solo: Tinta
Medina.
Suryana. (2012). Metodologi Penelitian. Bogor.
The Analysis and Implementation of Haversine Formulas in Determining Qibla Direction by Using Sphiral Trigonometry in Indonesia
271