HP Forums
Predicting Lunar Eclipses with the HP Prime - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: Predicting Lunar Eclipses with the HP Prime (/thread-18818.html)



Predicting Lunar Eclipses with the HP Prime - cdeaglejr - 09-14-2022 05:50 PM

This HP Prime program can be used to predict the local circumstances of lunar eclipses.

The lunar_eclipse software provides the eclipse type, the universal times and topocentric coordinates of the Moon at the beginning and end of the penumbra contacts, and the time and coordinates at maximum eclipse. It will also report the total eclipse duration.

The program will interactively request an initial calendar date at which to start the eclipse search along with a search duration in days.

The user's geographic coordinates should be provided in the following section of the main program source code starting at line 161. Please note the valid range of inputs and the sign conventions.

//////////////////////////
// observer coordinates
//////////////////////////

// geographic latitude of the observer
// (-90 <= degrees <= +90, 0 <= minutes <= 60, 0 <= seconds <= 60)
// (north latitude is positive, south latitude is negative)

obslat := dtr * (39.0 + 40.0 / 60.0 + 36 / 3600.0);

// geographic longitude of the observer
// (0 <= degrees <= 360, 0 <= minutes <= 60, 0 <= seconds <= 60)
// (east longitude is positive, west longitude is negative)

obslong := -dtr * (104.0 + 57.0 / 60.0 + 12.0 / 3600.0);

// altitude of the observer (meters)
// (positive above sea level, negative below sea level)

obsalt := 1644.0;

A PDF document describing the geometry and numerical method used to solve this classic astronomy problem is included in the attached zip archive.