I wanted to practice prayer times, all the codes are correct, but the result is wrong, there may be a problem in the sinuses. Sunset and sunrise times formulas and at noon the sun is the peak time formulas could be wrong.
public void onLocationChanged(Location loc) {
GPSEnlem = loc.getLatitude();
GPSBoylam = loc.getLongitude();
String Text = "Bulunduğunuz konum bilgileri : \n" + "Latitud = " + loc.getLatitude() + "\nLongitud = " + loc.getLongitude();
konumText.setText(Text);
String pattern = "dd_MM_yyyy";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
String date = simpleDateFormat.format(new Date());
String day = date.substring(0, 1);
String month = date.substring(3, 4);
String year = date.substring(6, 9);
double dayy = Double.valueOf(day);
double monthh = Double.valueOf(month);
double yearr = Double.valueOf(year);
double I = yearr;
double J = monthh;
double K = dayy;
double jd = 665176 + (1461 * (I + 4800 + (J - 14) / 12)) / 4 + (367 * (J - 2 - 12 * ((J - 14) / 12))) / 12 - (3 * ((I + 4900 + (J - 14) / 12) / 100)) / 4 + K - 32075;
double d = jd - 2451545; // jd verilen Jülyen tarihidir
double g = 357.529 + 0.98560028 * d;
double q = 280.459 + 0.98564736 * d;
double L = q + 1.915 * sin(Math.toRadians(g)) + 0.020 * sin(Math.toRadians(2 * g));
double R = 1.00014 - 0.01671 * cos(Math.toRadians(g)) - 0.00014 * cos(Math.toRadians(2 * g));
double e = 23.439 - 0.00000036 * d;
double RA = atan2(cos(Math.toRadians(e)) * sin(Math.toRadians(L)), cos(Math.toRadians(L))) / 15;
double D = asin(sin(Math.toRadians(e)) * sin(Math.toRadians(L))); // Güneş'in sapması
double EqT = q / 15 - RA; // zaman denklemi
double Lng = 30.0;
double Ltd = 39.0;
double SaatDilimi = 3;
double oglevakti = 12.0 + SaatDilimi - (Lng / 15.0) - EqT;
double a = 0;
double n = d;
double Jk = n - (Lng / 360.0);
double M = (357.5291 + 0.98560028 * Jk) % 360.0;
double C = 1.9148 * sin(M) + 0.0200 * sin(2.0 * M) + 0.0003 * sin(3.0 * M);
double lambda = (M + C + 180 + 102.9372) % 360.0;
double si = asin(sin(lambda) * sin(23.4397));
double Ta = (acos(-sin(a) - sin(Ltd) * sin(si))) / 15.0;
double T0833 = acos(-sin(0.833) - sin(GPSEnlem) * sin(si)) / 15.0;
double T17 = acos(Math.toRadians(-sin(17) - sin(GPSEnlem) * sin(si))) / 15.0;
double T18 = acos(Math.toRadians(-sin(18) - sin(GPSEnlem) * sin(si))) / 15.0;
double gunesvakti = oglevakti - T0833;
double aksamvakti = oglevakti + T0833;
double imsakvakti = oglevakti - T18;
double yatsivakti = oglevakti + T17;
double AL = 2 + abs(tan(GPSEnlem) - si);
double A2 = 1 / AL;
double ikindivakti = oglevakti + A2;
}