# Geometric Calculation of Qibla Direction

The direction of Qibla at any point on the Earth’s surface, assuming the Earth to be a perfect sphere, is given by the great circle passing through that point and the Kaabatullah at Makkah. The angle between the true north at a place and the qibla direction there can be obtained by solving the spherical triangle whose vertices are, the north pole, the intended place, and Makkah. Determination of qibla direction for daily prayers is not as easy as just calculating it from Spherical geometry equation:

 Q = tan-1 sin (Ld – Lm)[ (cos Fd) x (tan Fm) ] – [ (sin Fd) x (cos Ld – Lm) ] Where: Fd = Latitude of Desired LocationLd = Longitude of Desired LocationFm = Latitude of Mecca (+21.45Â° north of Equator)Lm = Longitude of Mecca (-39.75Â° east of Prime Meridian)

An example: Bakersfield California ( Fd = +35Â°23Â´ = 35.3833Â°
Ld = 119Â°1Â´ = 119.0166Â° )

 Q = tan-1 sin (119.0166 – (-39.75))[ (cos 35.3833) x (tan 21.45) ] – [ (sin 35.3833) x (cos 119.0166 – (-39.75)) ] = [ { .3622 } Ã· { .3203 – (-.5397) } ] = +22.863 degrees = +22Â°51Â´46.8″ East from True North

This angle has to be modified by the amount of Magnetic Declination because there are two Norths involved. One is the True North (TN) and the other is the Magnetic North (MN). The problem arises when the equation gives the angle from the TN and the compass gives the angle from the MN. The difference between the two Norths is called the Magnetic Declination (MD). The reading of the compass has to be modified and compensated by the value of this MD for the location. The values for these MDs are available from the Canadian National Geophysical Laboratory website.

To obtain this MD you need to provide the Latitude and the Longitude of the location for which the qibla direction is desired (Fd and Ld from above) along with the year it is needed for as this MD varies slightly from year to year. The Latitudes & the Longitudes for most cities of the world are available at Google Maps.

To be very accurate in measuring the qibla direction, it is best to use a portable Marine compass of a minimum 6″ card diameter, even with a good quality instrument the most accuracy you can expect is upto Â±Â½ degrees (30 minutes). I think you will have to try to get the best accuracy you find possible and Allah will understand that your tools are only those of humans.

The MD provided at the above site will be in terms of degrees & minutes East or West. If it is E variation, the True angle will be that much to the right of your magnetic compass measurement. If it is W then the MD gets added to your calculated angle to give the True angle to be measured on the magnetic compass.

For example, MD for Bakersfield CA is 14Â° 22Â´ E and the calculated angle for this location is 22Â° 51Â´ 46.8″ (Required magnetic compass angle added to MD of 14Â° 22Â´ should equal calculated angle from Spherical geometry equation, 22Â° 51Â´ 46.8″). This gives an angle of 8Â° 29Â´ 46.8″ to be read on the magnetic compass to truly face Kaaba at this location.

When you put your magnetic compass on the ground at your site and make it level (making sure there is no magnetic materials, tools, etc. near the compass that can have an effect on the compass reading), the N marking on the compass card will point to the MN. TN is 14Â° 22Â´ further left of this N marking. Then 8Â° 29Â´ 46.8″ to the right of N marking is the magnetic bearing to Kaaba, which is same as 22Â° 51Â´ 46.8″ true bearing towards Kaaba as calculated by the equation.