Package org.shredzone.commons.suncalc
Class MoonPhase
java.lang.Object
org.shredzone.commons.suncalc.MoonPhase
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Collects all parameters forMoonPhase
.static enum
Enumeration of moon phases. -
Method Summary
Modifier and TypeMethodDescriptionstatic MoonPhase.Parameters
compute()
Starts the computation ofMoonPhase
.double
Geocentric distance of the moon at the given phase, in kilometers.getTime()
Date and time of the desired moon phase.boolean
Checks if the moon is in a MicroMoon position.boolean
Checks if the moon is in a SuperMoon position.toString()
-
Method Details
-
compute
Starts the computation ofMoonPhase
.- Returns:
MoonPhase.Parameters
to set.
-
getTime
Date and time of the desired moon phase. The time is rounded to full minutes. -
getDistance
Geocentric distance of the moon at the given phase, in kilometers.- Since:
- 3.4
-
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
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
-