while the great circle method yields 18°51′05″. Calculations with spherical trigonometry The great circle model is applied to calculate the qibla using spherical trigonometry—a branch of geometry that deals with the mathematical relations between the sides and angles of triangles formed by three great circles of a sphere (as opposed to the conventional trigonometry which deals with those of a two-dimensional triangle). In the accompanying figure (captioned "Calculating the qibla"), a location , the Kaaba , and the north pole form a triangle on the sphere of the earth. The qibla is indicated by , which is the direction of the great circle passing through both and . The qibla can also be expressed as an angle, (or ), of the qibla with respect to the north, also called the inhiraf al-qibla. This angle can be calculated as a mathematical function of the local latitude , the latitude of the Kaaba , and the longitude difference between the locality and the Kaaba . This function is derived from the cotangent rule which applies to any spherical triangle with angles , , and sides , , : Applying this formula in the spherical triangle (substituting ) and applying trigonometric identities obtain: , or For example, the qibla from the city of Yogyakarta, Indonesia, can be calculated as follows. The city's coordinates, , are 7.801389°S, 110.364444°E, while the Kaaba's coordinates, , are 21.422478°N, 39.825183°E. The longitude difference is (110.364444 minus 39.825183) 70.539261. Substituting the values into the formula obtains: . which gives: . The calculated qibla for the city of Yogyakarta is therefore 295°, or 25° north of west. This formula was derived by modern scholars, but equivalent methods have been known to Muslim astronomers since the 9th century (3rd century ), developed by various scholars, including Habash al-Hasib (active in Damascus and Baghdad ), Al-Nayrizi (Baghdad, ), Ibn Yunus (10th–11th century), Ibn al-Haytham (11th century), and Al-Biruni (11th century). Today spherical trigonometry also underlies nearly all applications or websites which calculate the qibla. When the qibla angle with respect to the north, , is known, true north needs to be known to find the qibla in practice. Common practical methods to find it include the observation of the shadow at the culmination of the sun—when the sun crosses exactly the local meridian. At this point, any vertical object would cast a shadow oriented in the north–south direction. The result of this