I am reading the book by Berggren, 'Episodes in the mathematics of medieval islam'. An important problem is determing the direction of Mecca with respect to a local city. The book introduced a method invented by Al-Biruni.
But it is based on the assumption that both the coordinates (latitudes and longitudes) of Mecca and the locality are known. While it is relatively easy to determine the latitude of a point, I cannot see how to determine the difference in longitude between two points.
So what is the ancient trick?