Learn R Programming

astrolibR (version 0.1)

mphase: Calculate the illuminated fraction of the Moon at given Julian date(s)

Description

Calculate the illuminated fraction of the Moon at given Julian date(s)

Usage

mphase(jd)

Arguments

jd
Julian date, scalar or vector

Value

k
illuminated fraction of Moon's disk (0.0 < k < 1.0), same number of elements as jd.

Details

The output k = 0 indicates a new moon, while k = 1 indicates a full moon.

The algorithm is from Meeus (1991, Chpt. 46) The functions sunpos and moonpos are used to get positions of the Sun and the Moon (and the Moon distance). The selenocentric elongation of the Earth from the Sun (phase angle) is then computed, and used to determine the illuminated fraction.

References

Meeus, J., 1991, "Astronomical Algorithms", Willmann-Bell, Richmond

See Also

sunpos moonpos

Examples

Run this code

mphase(2456877.5)

#  Plot the illuminated fraction of the moon for every day in July 
#  1996 at 0 TD (Greenwich noon).
#
# jd = jdcnv(1996, 7, 1, 0)         # Get Julian date of July 1
# phases = mphase(jd:(jd+31))       # Moon phase for all 31 days
# plot(1:31,phases)                 # Plot phase vs. July day number

Run the code above in your browser using DataLab