View Single Post
Posts: 85 | Thanked: 38 times | Joined on Sep 2010 @ Canada
#29
Originally Posted by ejasmudar View Post
Basically, how it works is, it takes the time, the date, and the geographical location and predicts the position of the sun/moon (probably from an algorithm as the aforesaid app did not connect to the net) wrt to a compass. Now the direction of the qibla is overlaid on the image and a person can align his mobile with the sun and get the correct qibla direction.
This is doable but might take us quite some time. We are already using a library that uses the great circle method to find the direction of the qibla.

So what we would need to add is an algorithm that also finds the direction to the sun, which updates itself over the course of the day and we can display the relative positions based on that.

Here is a description of how to find the sun:

http://www.math.niu.edu/~rusin/uses-...solar.position
 

The Following 2 Users Say Thank You to abuelmagd For This Useful Post: