Package org.shredzone.commons.suncalc
Class MoonIllumination
java.lang.Object
org.shredzone.commons.suncalc.MoonIllumination
Calculates the illumination of the moon.
Starting with v3.9, a geolocation can be set optionally. If set, the results will be topocentric, relative to the given location. If not set, the result is geocentric, which was the standard behavior before v3.9.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MoonIllumination.Parameters
compute()
Starts the computation ofMoonIllumination
.double
getAngle()
The angle of the moon illumination relative to earth.The closestMoonPhase.Phase
that is matching the moon's angle.double
The width of the moon crescent, as observed from a specific location on earth.double
The elongation, which is the angular distance between the moon and the sun as observed from a specific location on earth.double
Illuminated fraction.double
getPhase()
Moon phase.double
The radius of the moon disk, as observed from a specific location on earth.toString()
-
Method Details
-
compute
Starts the computation ofMoonIllumination
.- Returns:
MoonIllumination.Parameters
to set.
-
getFraction
Illuminated fraction.0.0
indicates new moon,1.0
indicates full moon. -
getPhase
Moon phase. Starts at-180.0
(new moon, waxing), passes0.0
(full moon) and moves toward180.0
(waning, new moon).Note that for historical reasons, the range of this phase is different to the moon phase angle used in
MoonPhase
. -
getAngle
The angle of the moon illumination relative to earth. The moon is waxing if the angle is negative, and waning if positive.By subtracting
MoonPosition.getParallacticAngle()
fromgetAngle()
, one can get the zenith angle of the moons bright limb (anticlockwise). The zenith angle can be used do draw the moon shape from the observer's perspective (e.g. the moon lying on its back). -
getClosestPhase
The closestMoonPhase.Phase
that is matching the moon's angle.- Returns:
- Closest
MoonPhase.Phase
- Since:
- 3.5
-
getElongation
The elongation, which is the angular distance between the moon and the sun as observed from a specific location on earth.- Returns:
- Elongation between moon and sun, in degrees.
- Since:
- 3.9
-
getRadius
The radius of the moon disk, as observed from a specific location on earth.- Returns:
- Moon radius, in degrees.
- Since:
- 3.9
-
getCrescentWidth
The width of the moon crescent, as observed from a specific location on earth.- Returns:
- Crescent width, in degrees.
- Since:
- 3.9
-
toString
-