How to Calculate Qibla Direction

by Petra Wakefield

Qibla locates the geographic direction to the Ka'bah, a holy object of Islam kept in a mosque in Mecca. Muslims face Mecca for their daily prayers, so a practicing Muslim always needs to know the Qibla direction. By performing a few trigonometric calculations, you can find the Qibla direction from anywhere you happen to be. You need to know the latitude and longitude of the Ka'bah for these calculations; according to the Islamic Society of North America, the latitude is 21 degrees north and the longitude is 40 degrees east.

Measure your current latitude and longitude by finding your location on a map or globe and reading the latitude and longitude lines. You can also use a fix from a Global Positioning System satellite receiver.

Calculate the sine and the cosine of your current latitude.

Find the tangent of the the latitude of Mecca.

Subtract the longitude of Mecca from the longitude of your current location. Find the sine and cosine of this number.

Multiply the tangent of Mecca's latitude by the cosine of your latitude, then subtract this number from the product of the sine of your latitude and the cosine of the difference in longitudes.

Divide the number you just obtained by the sine of the difference in longitudes.

Calculate the tangent of this number. The result is the Qibla direction, measured in degrees clockwise from due North.


  • For this calculation, northern latitudes and eastern longitudes are positive, while southern latitudes and western longitudes are negative.

Items you will need

  • Scientific calculator

About the Author

Petra Wakefield is a writing professional whose work appears on various websites, focusing primarily on topics about science, fitness and outdoor activities. She holds a Master of Science in agricultural engineering from Texas A&M University.

Photo Credits

  • Hemera Technologies/ Images