Enum SunTimes.Twilight

java.lang.Object
java.lang.Enum<SunTimes.Twilight>
org.shredzone.commons.suncalc.SunTimes.Twilight
All Implemented Interfaces:
Serializable, Comparable<SunTimes.Twilight>, java.lang.constant.Constable
Enclosing class:
SunTimes

public static enum SunTimes.Twilight extends Enum<SunTimes.Twilight>
Enumeration of predefined twilights.

The twilight angles use a geocentric reference, by definition. However, VISUAL and VISUAL_LOWER are topocentric, and take the spectator's elevation and the atmospheric refraction into account.

See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static SunTimes.Twilight[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SunTimes.Twilight valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getAngle

      public double getAngle()
      Returns the sun's angle at the twilight position, in degrees.
    • getAngleRad

      public double getAngleRad()
      Returns the sun's angle at the twilight position, in radians.
    • isTopocentric

      public boolean isTopocentric()
      Returns true if this twilight position is topocentric. Then the parallax and the atmospheric refraction is taken into account.