// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class approx_sun_coord {
//     double D;   /* Declination of the Sun */
//     double EqT; /* The Equation of Time */
//     double R;   /* The distance of the Sun from the Earth
//                in astronomical units (AU)  */
//     double SD;  /* The angular semidiameter of the Sun in degrees */
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class date_t {
//     int year, month, day;
// 
//     /**
//      * @param day starts from 1
//      * @param month starts from 1, like the old ITL
//      */
//     date_t set(int day, int month, int year) {
//         this.year = year;
//         this.month = month;
//         this.day = day;
//         return this;
//     }
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class location {
//     /* In original C: The struct members ordering guarantees that the compiler does
//      * not add any padding bytes when compiling for 64-bit machines */
// 
//     double longitude;   /* Observer's longitude */
//     double latitude;    /* Observer's latitude */
//     double altitude;    /* Observer's altitude in meters */
//     double timezone;    /* Observer's timezone (in hours) relative
//                               to Universal Coordinated Time (UTC) */
//     int daylight;    /* Daylight Savings Time (DST) Flag
//                               Set to 1 if DST is on, 0 otherwise */
//     AsrMethod asr_method;  /* Asr Method: Shafii or Hanafi */
//     CalcMethod calc_method; /* Fajr and Isha Calculation method */
//     ExtremeMethod extr_method; /* Extreme latitude method */
//     String name;    /* Observer's location name */
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// enum round_t {
//     UP, DOWN, NEAREST
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static final double KAABA_LATITUDE = (21.42249);
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static final double KAABA_LONGITUDE = (39.82620);
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static final double M_PI = (3.141592653589793);
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static final double ONE_MINUTE = (60.0 / 3600.0);


import static org.arabeyes.itl.newmethod.DefsModule.ONE_MINUTE;
import org.arabeyes.itl.newmethod.DefsModule.approx_sun_coord;
import org.arabeyes.itl.newmethod.DefsModule.date_t;
import org.arabeyes.itl.newmethod.DefsModule.location;
import org.arabeyes.itl.newmethod.DefsModule.round_t;
import static java.lang.Math.acos;
import static java.lang.Math.asin;
import static java.lang.Math.atan2;
import static java.lang.Math.ceil;
import static java.lang.Math.cos;
import static java.lang.Math.floor;
import static java.lang.Math.sin;
import static java.lang.Math.sqrt;
import static java.lang.Math.tan;
import static org.arabeyes.itl.newmethod.DefsModule.KAABA_LATITUDE;
import static org.arabeyes.itl.newmethod.DefsModule.KAABA_LONGITUDE;
import static org.arabeyes.itl.newmethod.DefsModule.M_PI;
        return qibla;
    }

    static void get_prayer_times(date_t date,
                                 location loc,
                                 PrayerTimes pt) {
        int jdn, jdn_next, jdn_prev;
        double true_noon, sunrise, sunset;
        double noon_next, sunrise_next;
        double noon_prev, sunset_prev;
        double fajr, dhuhr, asr, maghrib, isha;
        final approx_sun_coord coord = new approx_sun_coord(), coord_next = new approx_sun_coord(),
                coord_prev = new approx_sun_coord();

        assert (date != null);
        assert (loc != null);
        assert (pt != null);

        jdn = get_julian_day_number(date);
        jdn_next = jdn + 1;
        jdn_prev = jdn - 1;

        get_approx_sun_coord(jdn, coord);
        get_approx_sun_coord(jdn_next, coord_next);
        get_approx_sun_coord(jdn_prev, coord_prev);

        true_noon = get_dhuhr(loc, coord);
        noon_next = get_dhuhr(loc, coord_next);
        noon_prev = get_dhuhr(loc, coord_prev);

// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class approx_sun_coord {
//     double D;   /* Declination of the Sun */
//     double EqT; /* The Equation of Time */
//     double R;   /* The distance of the Sun from the Earth
//                in astronomical units (AU)  */
//     double SD;  /* The angular semidiameter of the Sun in degrees */
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class date_t {
//     int year, month, day;
// 
//     /**
//      * @param day starts from 1
//      * @param month starts from 1, like the old ITL
//      */
//     date_t set(int day, int month, int year) {
//         this.year = year;
//         this.month = month;
//         this.day = day;
//         return this;
//     }
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static class location {
//     /* In original C: The struct members ordering guarantees that the compiler does
//      * not add any padding bytes when compiling for 64-bit machines */
// 
//     double longitude;   /* Observer's longitude */
//     double latitude;    /* Observer's latitude */
//     double altitude;    /* Observer's altitude in meters */
//     double timezone;    /* Observer's timezone (in hours) relative
//                               to Universal Coordinated Time (UTC) */
//     int daylight;    /* Daylight Savings Time (DST) Flag
//                               Set to 1 if DST is on, 0 otherwise */
//     AsrMethod asr_method;  /* Asr Method: Shafii or Hanafi */
//     CalcMethod calc_method; /* Fajr and Isha Calculation method */
//     ExtremeMethod extr_method; /* Extreme latitude method */
//     String name;    /* Observer's location name */
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// enum round_t {
//     UP, DOWN, NEAREST
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static final double KAABA_LATITUDE = (21.42249);
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static final double KAABA_LONGITUDE = (39.82620);
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static final double M_PI = (3.141592653589793);
// 
// Path: itl/src/main/java/org/arabeyes/itl/newmethod/DefsModule.java
// static final double ONE_MINUTE = (60.0 / 3600.0);


// Path: itl/src/main/java/org/arabeyes/itl/newmethod/PrayerModule.java
import static org.arabeyes.itl.newmethod.DefsModule.ONE_MINUTE;
import org.arabeyes.itl.newmethod.DefsModule.approx_sun_coord;
import org.arabeyes.itl.newmethod.DefsModule.date_t;
import org.arabeyes.itl.newmethod.DefsModule.location;
import org.arabeyes.itl.newmethod.DefsModule.round_t;
import static java.lang.Math.acos;
import static java.lang.Math.asin;
import static java.lang.Math.atan2;
import static java.lang.Math.ceil;
import static java.lang.Math.cos;
import static java.lang.Math.floor;
import static java.lang.Math.sin;
import static java.lang.Math.sqrt;
import static java.lang.Math.tan;
import static org.arabeyes.itl.newmethod.DefsModule.KAABA_LATITUDE;
import static org.arabeyes.itl.newmethod.DefsModule.KAABA_LONGITUDE;
import static org.arabeyes.itl.newmethod.DefsModule.M_PI;

        return qibla;
    }

    static void get_prayer_times(date_t date,
                                 location loc,
                                 PrayerTimes pt) {
        int jdn, jdn_next, jdn_prev;
        double true_noon, sunrise, sunset;
        double noon_next, sunrise_next;
        double noon_prev, sunset_prev;
        double fajr, dhuhr, asr, maghrib, isha;
        final approx_sun_coord coord = new approx_sun_coord(), coord_next = new approx_sun_coord(),
                coord_prev = new approx_sun_coord();

        assert (date != null);
        assert (loc != null);
        assert (pt != null);

        jdn = get_julian_day_number(date);
        jdn_next = jdn + 1;
        jdn_prev = jdn - 1;

        get_approx_sun_coord(jdn, coord);
        get_approx_sun_coord(jdn_next, coord_next);
        get_approx_sun_coord(jdn_prev, coord_prev);

        true_noon = get_dhuhr(loc, coord);
        noon_next = get_dhuhr(loc, coord_next);
        noon_prev = get_dhuhr(loc, coord_prev);

        sunrise = get_sunrise(true_noon, loc, coord);