Sun/Moon Rise/Set
Version 2.1.2 (1.06 MB) by
Meysam Mahooti
Rising and setting times of the Sun and the Moon and twilight times
Year, month, day, lambda (Geographic east longitude of the observer in [deg]), phi (Geographic latitude of the observer in [deg]), zone (local time - universal time in [h]) and twilight (Indicates civil, nautical or astronomical twilight) are received, then rising and setting times of the Sun and the Moon and twilight times are computed.
east longitude and latitude of the observer can be found at:
local time - universal time is available here (daylight saving time is considered):
Reference:
Montenbruck O., Pfleger T.; Astronomy on the Personal Computer; Springer Verlag, Heidelberg; 4th edition (2000).
Cite As
Meysam Mahooti (2026). Sun/Moon Rise/Set (https://se.mathworks.com/matlabcentral/fileexchange/55257-sun-moon-rise-set), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2021b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- Sciences > Geoscience > Oceanography and Hydrology >
- Sciences > Geoscience > Weather and Atmospheric Science >
Find more on Oceanography and Hydrology in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Sunset
| Version | Published | Release Notes | |
|---|---|---|---|
| 2.1.2 | Quad.m was modified. |
||
| 2.1.1 | test_Sunset.m, Mjday.m, and invjday.m were modified. |
||
| 2.1.0.0 | The header of SunPos.m and MoonPos.m are modified. |
||
| 2.0.0.0 | Accuracy is improved using planetary positions (SunPos.m and MoonPos.m) with respect to true equator and equinox of date rather than mean equator and equinox of date. |
||
| 1.1.0.0 | SinAlt.m is modified and CityName.m is added to give the name of city you have entered its geographical latitude and longitude.
|
||
| 1.0.0.0 |
