K-Nearest Neighbors for Fast and Accurate Qibla Direction Determination - Azhari, Ahmad; Wardoyo, Girindra Sulistiyo (Universitas Ahmad Dahlan, 2025)
Determining the correct direction of the Qibla is essential for the validity of prayer, but in areas far from the Kaaba, this can be a challenge. While calculating the Qibla azimuth using latitude and longitude is relatively straightforward, traditional methods for obtaining the Qibla direction, such as those provided by the Muhammadiyah Central Leadership’s Tarjih Center, are time-consuming and require specialized teams. This paper proposes a recommendation system that uses the K-Nearest Neighbors (K-NN) algorithm to provide an efficient and automated solution for determining the Qibla direction. The system leverages the Google Maps API to obtain geographic coordinates and calculates the Qibla azimuth by applying the Euclidean distance formula between latitude and longitude points. The K-NN method is employed to recommend the nearest mosque or prayer room that is aligned with the correct Qibla direction, based on proximity and geographic data. This approach eliminates the need for a dedicated team and significantly reduces the time required for users to find the correct direction. The system's performance was tested through Black Box testing to ensure all features functioned as expected. User acceptance was measured using the System Usability Scale (SUS), resulting in an average score of 76.33, indicating good usability. Additionally, accuracy testing compared the recommended Qibla direction from 28 mosques and prayer rooms with another established system, yielding an accuracy of 78.57%. These results demonstrate that the proposed K-NN-based recommendation system is both effective and efficient for determining the Qibla direction.