A MATLAB Script for Computing Phases of the Moon
You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
This MATLAB script uses Brent's one-dimensional extrema algorithm to determine the calendar date and UTC time of phases of the Moon.
phases of the Moon
===============
please input the initial calendar date
(1 <= month <= 12, 1 <= day <= 31, year = all digits!)
? 1,1,2025
please input the simulation period (days)
? 120
new moon
--------------
calendar date 29-Jan-2025
UTC time 12:36:24
illumination 0.00 percent
first quarter
---------------
calendar date 05-Feb-2025
UTC time 08:02:42
illumination 50.00 percent
full moon
------------
calendar date 12-Feb-2025
UTC time 13:53:44
illumination 100.00 percent
last quarter
---------------
calendar date 20-Feb-2025
UTC time 17:33:08
illumination 50.00 percent
Cite As
David Eagle (2026). Computing Phases of the Moon (https://www.mathworks.com/matlabcentral/fileexchange/70991-computing-phases-of-the-moon), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.1.0 (12.8 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
