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.
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)
but result is not like this