
by Marco Paland, December 10
Finding the Qibla to the Kaaba in Mecca
The qibla (Arabic: قِبْلَة, lit. 'direction') is the direction towards the Kaaba in the Sacred Mosque in Mecca, which is used by Muslims in various religious contexts, particularly the direction of prayer for the salah.
The most common technical definition used by Muslim astronomers is the direction on the great circle in the Earth’s Sphere passing through the actual location and the Kaaba, giving the direction of the shortest possible path between the two.
To implement a mobile finder, we need the actual location, the Kaaba location and an exact compass direction to calculate the qibla.
To implement this in tyckr as a widget or watch face, we take the Location Provider to get the actual location, the Orientation Provider for the compass direction and the Navigation Provider to calculate the distance (just nice to know) and the bearing.
Behind the Scenes
The Navigation Provider calculates various navigation data between two GPS coordinates, including the distance and bearing between two points on a sphere given their longitudes and latitudes by using the haversine formula.
As the GPS coordinates are referring to true north, the bearing needs to be converted to magnetic north to get the accurate direction. This is done by the Orientation Provider using the WMM2025 model, which provides the magnetic declination for a given location and time.
However, the precision depends completely on the quality of the integrated compass.
While developing the idea of the Qibla Finder, the idea of calculating prayer times came up. Muslim prayer times are based on the position of the sun, the earth and the actual position on it.
We wanted to create a really high precision prayer time calculation, so we are using the astronomical algorithms of Jean Meeus.
Creating the Face
Video is coming up soon. Stay tuned!