01

One direction for prayer

The qibla is the direction of the Kaaba in Makkah, which Muslims face during prayer. Mosques show it with a niche in the wall called a mihrab.

Because the Earth is round, the direction is not simply a straight line on a flat map.

02

Geometry on a sphere

The shortest path between two places on a globe is part of a great circle, an imaginary circle around the Earth’s centre. The qibla points along this path.

Muslim astronomers and mathematicians developed spherical trigonometry, the mathematics of triangles on a sphere, partly to calculate the qibla accurately from distant cities.

03

Compasses and apps

Special qibla compasses list the correct angle for different cities. Today, phone apps use GPS to find your position and calculate the direction instantly.

They combine the calculation with the phone’s built-in compass to point the way.

04

When the sun helps

Makkah lies between the equator and the Tropic of Cancer, so twice a year, around 27 or 28 May and 15 or 16 July, the sun passes almost directly over the Kaaba at midday in Makkah.

At that moment, a vertical stick anywhere the sun is visible casts a shadow pointing directly away from the Kaaba, so the qibla lies in the opposite direction. Astronomical societies announce these dates each year.

05

A safety note

When using the sun method, you look at shadows on the ground, never at the sun itself, because looking at the sun can harm your eyes.

Simple experiments with a stick and its shadow are a fun way to explore the sun’s path.

06

Science in service of worship

The challenge of finding the qibla helped advance geography, map-making and astronomy in the Islamic world, contributing to knowledge shared across cultures.

It is a wonderful example of mathematics helping people in everyday life.

07

Why it is a beautiful story

08

Questions people ask

What is the qibla?

The direction of the Kaaba in Makkah, which Muslims face in prayer.

Why can’t the qibla be drawn on a flat map?

The Earth is round, so the shortest direction follows a great circle.

When is the sun directly over the Kaaba?

Around 27 or 28 May and 15 or 16 July each year.

FOLLOW THE EVIDENCE

Sources & further reading

Sources checked 2 December 2026. Company names are used only to describe their work; Canvas of Knowledge is independent and these organisations do not endorse this website. Illustration: original AI-generated illustration (Adobe Firefly), an artist’s impression rather than a photograph.