Arab scholars had an interest in astronomical subjects.
Consequently they had solved the Qibla problem analytically as early as the tenth century.
That is, they knew the equation for the Qibla and constructed tables of the direction to Mecca for the Muslim world.