is an exact science—originating from pre-Islamic traditions. It used natural phenomenon, including the observation of the Sun, the Moon, the stars, and wind, without any basis in mathematics. These methods yield specific directions in individual localities, often using the fixed setting and rising points of a specific star, the sunrise or sunset at the equinoxes, or at the summer or the winter solstices. Historical sources record several such qiblas, for example: sunrise at the equinoxes (due east) in the Maghreb, sunset at the equinoxes (due west) in India, the origin of the north wind or the fixed location of the North Star in Yemen, the rising point of the star Suhayl (Canopus) in Syria, and the midwinter sunset in Iraq. Such directions appear in texts of fiqh (Islamic jurisprudence) and texts of folk astronomy. Astronomers (aside from folk astronomers) typically do not comment on these methods, but they were not opposed by Islamic legal scholars. The traditional directions were still in use when methods were developed to calculate the qibla more accurately, and they still appear in some surviving medieval mosques today. With astronomy The study of astronomy—known as ilm al-falak () in the Islamic intellectual tradition—began to appear in the Islamic World in the second half of the 8th century, centred in Baghdad, the principal city of the Abbasid Caliphate. Initially, the science was introduced through the works of Indian authors, but after the 9th century the works of Greek astronomers such as Ptolemy were translated into Arabic and became the main references in the field. Muslim astronomers preferred Greek astronomy because they considered it to be better supported by theoretical explanations and therefore it could be developed as an exact science; however, the influence of Indian astronomy survives especially in the compilation of astronomical tables. This new science was applied to develop new methods of determining the qibla, making use of the concept of latitude and longitude taken from Ptolemy's Geography as well as trigonometric formulae developed by Muslim scholars. Most textbooks of astronomy written in the medieval Islamic World contain a chapter on the determination of the qibla, considered one of the many things connecting astronomy with Islamic law (sharia). According to David A. King, various medieval solutions for the determination of the qibla "bear witness to the development of mathematical methods from the 3rd/9th to the 8th/14th centuries and to the level of sophistication in trigonometry