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

Lunar Day Calculation #18

Open
ryanve opened this issue Jun 26, 2021 · 6 comments
Open

Lunar Day Calculation #18

ryanve opened this issue Jun 26, 2021 · 6 comments
Assignees

Comments

@ryanve
Copy link

ryanve commented Jun 26, 2021

Cool library. How about adding a lunarDay method to calculate the lunar day. Seems doable by dividing the lunar age. On the new moon it'd return 1 and so on. Returning a float would work or have lunarDay return a floored integer and accompany it with a lunarDayPercent method that returns how far into that day we are. Thoughts?

@jasonsturges
Copy link
Owner

@ryanve Hi, thanks.

The lunageAge() should do that - it's Earth days since the last new moon.

Lunar Age

Age in Earth days through the current lunar cycle, equivalent to 29.53059 Earth days, based on Mean Synodic Month, 2000 AD mean solar days.

Phase Start Event End
New 0 1.84566173161
Waxing Crescent 1.84566173161 3.69132346322 5.53698519483
First Quarter 5.53698519483 7.38264692644 9.22830865805
Waxing Gibbous 9.22830865805 11.07397038966 12.91963212127
Full 12.91963212127 14.76529385288 16.61095558449
Waning Gibbous 16.61095558449 18.4566173161 20.30227904771
Last Quarter 20.30227904771 22.14794077932 23.99360251093
Waning Crescent 23.99360251093 25.83926424254 27.68492597415
New 27.68492597415 29.53058770576

To get the lunar age (ex: 16.54412413414952)

const age = Moon.lunarAge();

Does that work for you?

@ryanve
Copy link
Author

ryanve commented Aug 7, 2021

@jasonsturges thank you i've been wondering whether lunar days are different and i think lunar days are different than earth days. For example just before the new moon tomorrow will be the 30th lunar day. Lunar days are used in astrology like in this business calendar or shopping calender or haircut calender

@jasonsturges
Copy link
Owner

@ryanve Interesting, I'm not familiar how astrology calculates this.

Lunar vs lunisolar calendars align lunar months with the solar year through different intercalation - approximately 29.5 days, although it appears some calendars alternate between 29 and 30 day synodic months to complete one year of 12 lunations.

Here, using the Gregorian calendar, this fraction normalizes years (and leap years) providing accuracy for the next 31,000 years at which point this calculation will be 1-day behind.

But it is interesting that over this ~25,000 day fraction are 451 30-day full months and 399 29-day hollow months.

Not sure where to go from here... I'll look at how these alternating full / hollow months fit into current calculations, but there are other variations that might be applicable to your needs of astrology.

Would you know roots of astrology lunar calendars? Would they stem from Chinese, Hebrew, Hindu, Islamic, or other culture?

@ryanve
Copy link
Author

ryanve commented Sep 28, 2021

An Indian women explains about it YouTube. Sounds calculable in a global way but she says timezone has influence in application with local sunrise. MoonHoroscope has it on their homepage.

@jasonsturges jasonsturges self-assigned this Feb 9, 2022
@dannylin108
Copy link

I will be surprised, but Chinese astrology / Chinese calendar is doing it in another different way. Some months have 29 lunar days, others have 30. This way they approximate average 29.53059 days synodic month.

@jasonsturges
Copy link
Owner

@dannylin108 Yes, this average calculation provides accuracy for the next 31,000 years.

Several people have asked for variations of these calculations for different purposes. Besides researching the calculations, I've implemented a new options system that should better facilitate these requests.

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

3 participants