Computing Phases of the Moon

Version 1.1.0 (12.8 KB) by David Eagle
A MATLAB Script for Computing Phases of the Moon
147 Downloads
Updated 27 Jan 2025

View License

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 (2025). Computing Phases of the Moon (https://www.mathworks.com/matlabcentral/fileexchange/70991-computing-phases-of-the-moon), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Gravitation, Cosmology & Astrophysics in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0

Updated several algorithms, user inputs and script output.

1.0.0