Enum MoonPhase.Phase

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

public static enum MoonPhase.Phase extends Enum<MoonPhase.Phase>
Enumeration of moon phases.
  • Enum Constant Details

  • Method Details

    • values

      public static MoonPhase.Phase[] 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 MoonPhase.Phase 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
    • toPhase

      public static MoonPhase.Phase toPhase(double angle)
      Converts an angle to the closest matching moon phase.
      Parameters:
      angle - Moon phase angle, in degrees. 0 = New Moon, 180 = Full Moon. Angles outside the [0,360) range are normalized into that range.
      Returns:
      Closest Phase that is matching that angle.
      Since:
      3.5
    • getAngle

      public double getAngle()
      Returns the moons's angle in reference to the sun, in degrees.
    • getAngleRad

      public double getAngleRad()
      Returns the moons's angle in reference to the sun, in radians.