Ejemplo n.º 1
0
Archivo: Sun.java Proyecto: cnery/cnery
  /**
   * Calculate the UTC of evening astronomical twilight for the given day at the given latitude and
   * longitude on Earth
   *
   * @param julian Julian day
   * @param ll latitude and longitude of observer in degrees
   * @param timeZone the timeZone to use (e.g. Sun.GMT or Sun.PST)
   * @param dst true if daylight savings time (summer time) should be taken into account
   * @return time in minutes from zero Z
   */
  public static Time eveningAstronomicalTwilightTime(
      double julian, LatitudeLongitude ll, TimeZone timeZone, boolean dst) {
    double timeMins =
        eveningPhenomenon(
                julian, ll.getLatitude(), -ll.getLongitude(), ASTRONOMICAL_TWILIGHT_ZENITH_DISTANCE)
            + (timeZone.getRawOffset() / 60000.0);
    if (dst) timeMins += 60.0;

    return convertTime(timeMins);
  }
Ejemplo n.º 2
0
Archivo: Sun.java Proyecto: cnery/cnery
  /**
   * Calculate the UTC of sunrise for the given day at the given latitude and longitude on Earth
   *
   * @param julian Julian day
   * @param ll latitude and longitude of observer in degrees
   * @param timeZone the timeZone to use (e.g. Sun.GMT or Sun.PST)
   * @param dst true if daylight savings time (summer time) should be taken into account
   * @return time in minutes from zero Z
   */
  public static Time sunriseTime(
      double julian, LatitudeLongitude ll, TimeZone timeZone, boolean dst) {
    double timeMins =
        morningPhenomenon(
                julian, ll.getLatitude(), -ll.getLongitude(), SUNRISE_SUNSET_ZENITH_DISTANCE)
            + (timeZone.getRawOffset() / 60000.0);
    if (dst) timeMins += 60.0;

    return convertTime(timeMins);
  }
Ejemplo n.º 3
0
Archivo: Sun.java Proyecto: cnery/cnery
  /**
   * Calculate the UTC of morning civil twilight for the given day at the given latitude and
   * longitude on Earth
   *
   * @param julian Julian day
   * @param ll latitude and longitude of observer in degrees
   * @param timeZone the timeZone to use (e.g. Sun.GMT or Sun.PST)
   * @param dst true if daylight savings time (summer time) should be taken into account
   * @return time in minutes from zero Z
   */
  public static Time morningCivilTwilightTime(
      double julian, LatitudeLongitude ll, TimeZone timeZone, boolean dst) {
    double timeMins =
        morningPhenomenon(
                julian, ll.getLatitude(), -ll.getLongitude(), CIVIL_TWILIGHT_ZENITH_DISTANCE)
            + (timeZone.getRawOffset() / 60000.0);
    if (dst) timeMins += 60.0;

    return convertTime(timeMins);
  }