// Path: itl/src/main/java/org/arabeyes/itl/prayertime/PrayerModule.java
// static class Location {
//     double degreeLong;  /* Longitude in decimal degree. */
//     double degreeLat;   /* Latitude in decimal degree. */
//     double gmtDiff;     /* GMT difference at regular time. */
//     int dst;            /* Daylight savings time switch (0 if not used).
//                            Setting this to 1 should add 1 hour to all the
//                            calculated prayer times */
//     double seaLevel;    /* Height above Sea level in meters */
//     double pressure;    /* Atmospheric pressure in millibars (the
//                            astronomical standard value is 1010) */
//     double temperature; /* Temperature in Celsius degree (the astronomical
//                            standard value is 10) */
// 
//     Location() {
//     }
// 
//     Location(Location src) {
//         this.degreeLong = src.degreeLong;
//         this.degreeLat = src.degreeLat;
//         this.gmtDiff = src.gmtDiff;
//         this.dst = src.dst;
//         this.seaLevel = src.seaLevel;
//         this.pressure = src.pressure;
//         this.temperature = src.temperature;
//     }
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/prayertime/PrayerModule.java
// static class SDate {
//     int day;
//     int month;
//     int year;
// 
//     SDate() {
//     }
// 
//     SDate(SDate src) {
//         this.day = src.day;
//         this.month = src.month;
//         this.year = src.year;
//     }
// }


import org.arabeyes.itl.prayertime.PrayerModule.Location;
import org.arabeyes.itl.prayertime.PrayerModule.SDate;
import static java.lang.Math.acos;
import static java.lang.Math.asin;
import static java.lang.Math.atan;
import static java.lang.Math.atan2;
import static java.lang.Math.cos;
import static java.lang.Math.floor;
import static java.lang.Math.pow;
import static java.lang.Math.sin;
import static java.lang.Math.tan;
/*  Copyright (c) 2003-2006, 2009-2010 Arabeyes, Thamer Mahmoud
 *
 *  A full featured Muslim Prayer Times calculator
 *
 *  Most of the astronomical values and formulas used in this file are based
 *  upon a subset of the VSOP87 planetary theory developed by Jean Meeus. Page
 *  and formula numbers in-line below are references to his book: Astronomical
 *  Algorithms. Willmann-Bell, second edition, 1998.
 *
 * (www.arabeyes.org - under LGPL license - see COPYING file)
 */
package org.arabeyes.itl.prayertime;



class AstroModule {
    // Compatible with ITL 59bd87234aa87712a92b3fffb5497a43f121abf2

    /* Defaults */
    static final int INVALID_TRIGGER = 1;
    private static final double PI = 3.1415926535898;
    private static final double CENTER_OF_SUN_ANGLE = -0.833370; /* ..of sun's upper limb angle */
    private static final double EARTH_RADIUS = 6378140.0; /* Equatorial radius in meters */
    private static final double ALTITUDE_REFRACTION = 0.0347;
    static final double DEG_TO_10_BASE = 1 / 15.0;

    /* UTILITIES */

    static double DEG_TO_RAD(double A) {
        return ((A) * (PI / 180.0));
    }

    static double RAD_TO_DEG(double A) {
        return ((A) / (PI / 180.0));
    }

    static class Astro {
        double jd;      /* Astronomical Julian day (for local time with Delta-t) */
        double[] dec = new double[3];  /* Declination */
        double[] ra = new double[3];   /* Right Ascensions */
        double[] sid = new double[3];  /* Apparent sidereal time */
        double[] dra = new double[3];  /* Delta Right Ascensions */
        double[] rsum = new double[3]; /* Sum of periodic values for radius vector R */

        Astro() {
        }

        Astro(Astro src) {
            this.jd = src.jd;
            this.dec = src.dec;
            this.ra = src.ra;
            this.sid = src.sid;
            this.dra = src.dra;
            this.rsum = src.rsum;
        }
    }

    private static class AstroDay {
        double dec;
        double ra;
        double sidtime;
        double dra;
        double rsum;
    }

    private enum Type {
        SUNRISE,
        SUNSET
    }

    private AstroModule() {
    }

// Path: itl/src/main/java/org/arabeyes/itl/prayertime/PrayerModule.java
// static class Location {
//     double degreeLong;  /* Longitude in decimal degree. */
//     double degreeLat;   /* Latitude in decimal degree. */
//     double gmtDiff;     /* GMT difference at regular time. */
//     int dst;            /* Daylight savings time switch (0 if not used).
//                            Setting this to 1 should add 1 hour to all the
//                            calculated prayer times */
//     double seaLevel;    /* Height above Sea level in meters */
//     double pressure;    /* Atmospheric pressure in millibars (the
//                            astronomical standard value is 1010) */
//     double temperature; /* Temperature in Celsius degree (the astronomical
//                            standard value is 10) */
// 
//     Location() {
//     }
// 
//     Location(Location src) {
//         this.degreeLong = src.degreeLong;
//         this.degreeLat = src.degreeLat;
//         this.gmtDiff = src.gmtDiff;
//         this.dst = src.dst;
//         this.seaLevel = src.seaLevel;
//         this.pressure = src.pressure;
//         this.temperature = src.temperature;
//     }
// }
// 
// Path: itl/src/main/java/org/arabeyes/itl/prayertime/PrayerModule.java
// static class SDate {
//     int day;
//     int month;
//     int year;
// 
//     SDate() {
//     }
// 
//     SDate(SDate src) {
//         this.day = src.day;
//         this.month = src.month;
//         this.year = src.year;
//     }
// }


// Path: itl/src/main/java/org/arabeyes/itl/prayertime/AstroModule.java
import org.arabeyes.itl.prayertime.PrayerModule.Location;
import org.arabeyes.itl.prayertime.PrayerModule.SDate;
import static java.lang.Math.acos;
import static java.lang.Math.asin;
import static java.lang.Math.atan;
import static java.lang.Math.atan2;
import static java.lang.Math.cos;
import static java.lang.Math.floor;
import static java.lang.Math.pow;
import static java.lang.Math.sin;
import static java.lang.Math.tan;

/*  Copyright (c) 2003-2006, 2009-2010 Arabeyes, Thamer Mahmoud
 *
 *  A full featured Muslim Prayer Times calculator
 *
 *  Most of the astronomical values and formulas used in this file are based
 *  upon a subset of the VSOP87 planetary theory developed by Jean Meeus. Page
 *  and formula numbers in-line below are references to his book: Astronomical
 *  Algorithms. Willmann-Bell, second edition, 1998.
 *
 * (www.arabeyes.org - under LGPL license - see COPYING file)
 */
package org.arabeyes.itl.prayertime;



class AstroModule {
    // Compatible with ITL 59bd87234aa87712a92b3fffb5497a43f121abf2

    /* Defaults */
    static final int INVALID_TRIGGER = 1;
    private static final double PI = 3.1415926535898;
    private static final double CENTER_OF_SUN_ANGLE = -0.833370; /* ..of sun's upper limb angle */
    private static final double EARTH_RADIUS = 6378140.0; /* Equatorial radius in meters */
    private static final double ALTITUDE_REFRACTION = 0.0347;
    static final double DEG_TO_10_BASE = 1 / 15.0;

    /* UTILITIES */

    static double DEG_TO_RAD(double A) {
        return ((A) * (PI / 180.0));
    }

    static double RAD_TO_DEG(double A) {
        return ((A) / (PI / 180.0));
    }

    static class Astro {
        double jd;      /* Astronomical Julian day (for local time with Delta-t) */
        double[] dec = new double[3];  /* Declination */
        double[] ra = new double[3];   /* Right Ascensions */
        double[] sid = new double[3];  /* Apparent sidereal time */
        double[] dra = new double[3];  /* Delta Right Ascensions */
        double[] rsum = new double[3]; /* Sum of periodic values for radius vector R */

        Astro() {
        }

        Astro(Astro src) {
            this.jd = src.jd;
            this.dec = src.dec;
            this.ra = src.ra;
            this.sid = src.sid;
            this.dra = src.dra;
            this.rsum = src.rsum;
        }
    }

    private static class AstroDay {
        double dec;
        double ra;
        double sidtime;
        double dra;
        double rsum;
    }

    private enum Type {
        SUNRISE,
        SUNSET
    }

    private AstroModule() {
    }

    static double getSunrise(Location loc, Astro tastro) {