Class MoonPhase

java.lang.Object
org.shredzone.commons.suncalc.MoonPhase

public class MoonPhase extends Object
Calculates the date and time when the moon reaches the desired phase.

Note: Due to the simplified formulas used in suncalc, the returned time can have an error of several minutes.

  • Method Details

    • compute

      public static MoonPhase.Parameters compute()
      Starts the computation of MoonPhase.
      Returns:
      MoonPhase.Parameters to set.
    • getTime

      Date and time of the desired moon phase. The time is rounded to full minutes.
    • getDistance

      public double getDistance()
      Geocentric distance of the moon at the given phase, in kilometers.
      Since:
      3.4
    • isSuperMoon

      public boolean isSuperMoon()
      Checks if the moon is in a SuperMoon position.

      Note that there is no official definition of supermoon. Suncalc will assume a supermoon if the center of the moon is closer than 360,000 km to the center of Earth. Usually only full moons or new moons are candidates for supermoons.

      Since:
      3.4
    • isMicroMoon

      public boolean isMicroMoon()
      Checks if the moon is in a MicroMoon position.

      Note that there is no official definition of micromoon. Suncalc will assume a micromoon if the center of the moon is farther than 405,000 km from the center of Earth. Usually only full moons or new moons are candidates for micromoons.

      Since:
      3.4
    • toString

      public String toString()
      Overrides:
      toString in class Object