Solar Eclipse

Prediction of solar eclipse and its duration using the time of new moon
Updated 19 May 2023

View License

test_Eclipse.m calculates the central line of a solar eclipse and the duration of the total or annular phases, starting with the date of the next New Moon.
The core of the program is the Intersect function, in which the intersection of the axis of the shadow with the surface of the Earth is determined from the geocentric coordinates of the Sun and the Moon. In addition, the diameters of the two shadow cones near the Earth are calculated, from which the respective phases of the eclipse are determined. The Central function converts the equatorial coordinates of the umbra provided by Intersect into geographic coordinates, and also determines the duration of totality.
test_Eclipse.m requires step size of outputs and the date of new moon which is highlighted with letter "c" in moon phases results at the following link:
Moreover, EclTimer.m (as an extension to the Solar Eclipse.m) enables the local circumstances of an eclipse to be calculated for any given point which is accessible here:
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 (2024). Solar Eclipse (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021b
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!
Version Published Release Notes

MoonEqu.m and SunEqu.m were modified.


Mjday.m, invjday.m, and ETminUT.m were modified.

Ast_Const.m is called once to decrease CPU time.

Description is updated.

Summary is updated.

injday.m and Mjday.m are updated.

The image is added.
Sun and Moon positions are computed using JPL ephemeris rather than analytical series.
ETminUT.m and Eclipse.m are revised.

Description is updated.