File Exchange

image thumbnail

Moon Phases

version (16.4 MB) by Meysam Mahooti
Determination of lunar phases and checking for eclipses


Updated 19 Mar 2019

View Version History

View License

Input: year
Output: phases of the Moon and time of lunar eclipses are specified.
Montenbruck O., Pfleger T.; Astronomy on the Personal Computer; Springer Verlag, Heidelberg; 4th edition (2000).
Meeus J.; Astronomical Algorithms; Willmann-Bell; Richmond, Virginia; 2nd edition (1998).

Cite As

Meysam Mahooti (2021). Moon Phases (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (10)

Francesco Riggi

Jelmer Veenstra

The full matrix is not available anymore via the researchgate link, is it possible to add it to the file exchange instead of an external link?

Meysam Mahooti

Dear Jicai Zhang,
DE430Coeff.mat full matrix is now available in the following link:
Use it rather than existing DE430Coeff.mat matrix and get what you like!
Yours Faithfully
Meysam Mahooti

Jicai Zhang

I Love it!Thanks. Except it probably can not calculate the years before 1949 or after 2049.


Better to have the year as an input, as follows:
Year= input (' Select the year: ');
Remarks: outputs for year 1972 work _properly_, despite the note of WB Buddendorf user.

Michael Sampol

WB Buddendorf

This is a handy tool. However, the script enters an infinite loop in certain years. For example, in 1972 when it's determining the timing for the full moon, the script stops running. It seems this happens in the 'Pegasus' function where some of the variables (x3 first, other later on in the script) get NaN values. Is there a possibility to work around this? Tried changing the accuracy but doesn't seem to achieve much...

peter anderson

Sam Davidson

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!