How to find Qibla direction using your geographical location

M Rifat Hossain
3 min readSep 22, 2021

--

Fundamental

Lets first forget about the map, longitude and latitude lines of earth. Just assume you are standing on a huge sphere surface. Gravity pulls you toward the center of the sphere and you stand straightly against it. That is why thousands of kilometer beneath your feet there is the center of your planet.

Now, you choose a direction to start walking. You walked for hundreds of kilometers without changing the direction. The center of the planet would still be beneath your feet throughout the whole path. The fact will not change even if your walked around the sphere. It is possible only if your walking path creates a circle whose center is located on the center of the planet. If you drove or flew in a specific direction the characteristic of the path would remain the same.

Note: Every fixed directional movement on a planet’s surface creates an arc or circle whose center is the same as the planet’s center.

Now to find the direction of Qibla, you must find the circle with the same center as the earth’s and that connects you and Kaaba.

Projecting the Circle on Map

Now we are going to find the characteristic of the circle in the reference of longitude and latitude lines. The red circle showed in Figure 1 is the following circle. Its center is placed at the center of the world. And it has the same radius as the world’s. The points (λ, 0) and (λ+π, 0) of the circle crosses the equator line. The point (λ+π/2, A) reaches the maximum latitude and the point (λ+3π/2, -A) reaches the minimum latitude. After connecting all these points we find a sinusoidal curve on the map.

Let,

Latitude = Φ

Longitude = θ

Offset Longitude= λ

Highest Magnitude of the wave = A

Wavelength of the sinusoid is 2π.

Therefore, the equation of the following sinusoid,

Φ = A × sin(θ − λ) … … … (1)

Where, θ and Φ are variable and λ and A are constant. Therefore, to specify a sinusoid over the map we need to determine the values of λ and A.

Finding the path to Kaaba

By determining the constants of the sinusoid that intersects your and Kaaba’s location, we will find the straight path on earth surface that leads to Kaaba.

Let, your geographical location, (Φ, θ) = (Φ₀, θ₀)

Kaaba’s geographical location, (Φ, θ) = (21.4225π/180, 39.8262π/180) ;[All units are in radian]

Therefore, from equation (1),

21.4225π/180 = A × sin(39.8262π/180 − λ) … … … (2)

Φ = A × sin(θ − λ) … … … (3)

Dividing (2) by (3), we get,

Finding the Qibla direction

The sinusoidal equation or Path to Kaaba is found. Now, to determine the direction we use a simple formula,

Example

Imagine someone lives in Dhaka and he/she wants to find Qibla direction.

Dhaka city’s location, (Φ₀, θ₀) = (23.8103π/180, 90.4125π/180)

Therefore,

So, the qibla direction is either 8.1064°NW or 8.1064°SE

Kaaba is closer at West from Dhaka, so Qibla is at 8.1064°NW.

--

--

M Rifat Hossain

An undergrad student of Shahjalal University of Science and Technology, Sylhet.