# Want to find the angle of degree from latittude & longitude

I want to develop one Qibla app which helps to find out the direction of prayer for Muslims. Qibla is the direction of ka'ba located in KSA, and its angle will be different from different locations, and i want to find the angle of degree for Qibla from everywhere by fetching user's latitude and longittude.I found some calculations here, but not helped it (It gives wrong result, when i checked). Do anyone have any source or anyone can help me find out the angle of degree from lat & long. Thank you.

EDIT:

Calculation as per in the link

Fd: 11.8745° N

Ld: 75.3704° E

Fm: 21.45° Lm: -39.75°

Q = tan-1 sin (Ld - Lm) [ (cos Fd) x (tan Fm) ] - [ (sin Fd) x (cos Ld - Lm) ]

Where: Fd = Latitude of Desired Location Ld = Longitude of Desired Location Fm = Latitude of Mecca (+21.45° north of Equator) Lm = Longitude of Mecca (-39.75° east of Prime Meridian)

expected angle,Q=292°

but result is not like this

• What is wrong with the page you linked? – Aretino May 15 '17 at 10:26
• I didn't check the equations of your link, but I don't see the difference between that link and what you're trying to do. Maybe you want an explanation of how one gets to these equations? – N.Bach May 15 '17 at 16:31
• @Aretino I got wrong degrees for my location from that calculation. – Mumthezir VP May 16 '17 at 5:07
• @N.Bach But the angle of degree got from the calculation is wrong – Mumthezir VP May 16 '17 at 5:09
• Could you provide one set of input (latitude,longitude) coordinates and the expected output angle then? It will help in verifying equations of potential answerers. – N.Bach May 16 '17 at 10:01

Coordinates of Mecca: $21° 25′ 21″ N, 39° 49′ 34″ E =21.4225°, 39.826111°$ (I recommend you geoHack)