DeenToday

How the qibla is worked out

Why the shortest way to Mecca is not a straight line on a map, how the bearing is computed, and how to find it without a compass by the sun.

The shortest way is not the straight line on your map

Every flat map of a round earth lies about something. The Mercator projection, the one almost every map on a screen uses, keeps angles right locally and pays for it by stretching the poles: Greenland looks the size of Africa. It also makes the shortest route between two places look bent. A line of constant compass bearing drawn on it — a rhumb line — is not the shortest way at all. The shortest way across a sphere is an arc of a great circle, the circle whose plane passes through the centre of the earth, and it is the line an aircraft follows.

The qibla is the direction of that arc where you stand: its initial bearing. It changes along the route, which is why a great circle looks curved on a flat map and why the qibla from London is not the qibla from Paris even though the two cities face roughly the same way.

CityGreat circleA straight line on a flat mapOut by
London119.0°133.8°14.8°
New York58.5°101.3°42.8°
Sydney277.5°297.5°20.0°
Jakarta295.2°292.8°2.4°
Cairo136.1°138.1°2.0°
The difference, city by city

The error grows with distance and with latitude. Near Mecca it is negligible; from North America it is enormous. A mosque in New York aligned east-south-east from a map is forty degrees off.

The arithmetic, in one line

With φ₁ your latitude, φ₂ the Kaaba's and Δλ the difference in longitude:

bearing = atan2( sin Δλ , cos φ₁ · tan φ₂ − sin φ₁ · cos Δλ )

That is the whole of it. No elevation, no magnetic field, no projection, and no time: the direction does not change through the day or the year. The site computes it in your browser and checks it against the same figure derived a second way, through the normals of the two great circles, which agrees to the decimal.

Why the sun is a better instrument than a compass

A magnetic compass does not point north. It points along the local magnetic field, which differs from true north by the magnetic declination — a figure that varies from place to place, drifts from year to year, and is thrown off entirely by a steel beam, a car or a phone's own speaker. In parts of eastern Canada it exceeds twenty degrees.

The sun has no such defect. Its direction at a given minute is a matter of arithmetic, which is why the classical method of fixing a mihrab used the sun and not a needle. Two moments a day, computed on the qibla page, put the sun exactly on the qibla line or exactly opposite it; a shadow at either moment is the direction, drawn on your own floor, with an accuracy no phone sensor can match.

The oldest method of all

Twice a year the sun stands in the zenith over Mecca itself, because the Kaaba lies between the tropics at 21.4° north. At that instant every upright shadow in the sunlit half of the world lies along the qibla. Those two dates are computed from the sun's declination, and they are the most elegant answer there is to the question: no instrument, no table, no trust in anybody's arithmetic but your own eyes.

This page describes what the schools of law hold, with the source of each. It is not a fatwa. For your own case, ask a qualified scholar or your local imam.

Updated