Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eclipse): add getLunarSarosNumber #239

Open
michealroberts opened this issue Jul 22, 2024 · 0 comments
Open

feat(eclipse): add getLunarSarosNumber #239

michealroberts opened this issue Jul 22, 2024 · 0 comments

Comments

@michealroberts
Copy link
Member

To calculate the saros and inex numbers of an eclipse in every eclipse season from 11,000 BC to AD 15,000 based on a given approximate date:

First, calculate the index of the eclipse season as:

const index = Math.floor((datetime + 2882.55) * 2.1074515 + 0.5);

where "datetime" is the number of Gregorian years since January 1, 1 BC in the proleptic Gregorian calendar.

Next, calculate how many times a five-month period separates two targeted eclipses using the formula:

const N5 = Math.floor(index / 7.62263 + 1.024 
        - Math.pow(index / 2.107452 / 17200, 2) 
        - Math.pow(index / 2.107452 / 22300, 3) 
        + 0.09 * Math.sin((index - 0.79) / 0.3354265));

The saros number for the eclipse is then:

const saros = 5 * index - 38 * N5;

and the inex number is:

const inex = 8 * index - 61 * N5;

To calculate the saros and inex numbers for a lunar eclipse near a given date, add nine years to the date and find the numbers for the solar eclipse half a saros later, then subtract 7 from the solar saros number to obtain the lunar saros number, and subtract 13 from the solar inex number to obtain the lunar inex number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant