Last active
April 25, 2017 00:58
-
-
Save olcayertas/686d8b6f47962fe97fb3 to your computer and use it in GitHub Desktop.
Calculates qibla angel acording to curren location.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final double KAABA_LONGITUDE = 39.826228; | |
private static final double KAABA_LATITUDE = 21.422305; | |
private double getQiblaAngele(double myLatitude, double myLongitude) { | |
double sinMyLoMinusQLo = Math.sin(myLongitude - KAABA_LONGITUDE); | |
double cosMyLat = Math.cos(myLatitude); | |
double tanQLat = Math.tan(KAABA_LATITUDE); | |
double sinMyLat = Math.sin(myLatitude); | |
double cosMyLoMinusQlo = Math.cos(myLongitude - KAABA_LONGITUDE); | |
double result = Math.atan(sinMyLoMinusQLo / cosMyLat * tanQLat - sinMyLat * cosMyLoMinusQlo); | |
return Math.toDegrees(result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
there is a lot of maths operation ?
what dose the getQiblaAngele method exactly returns.
thanks for publish this code (;