Well, I think I'm done with the bulk of astronomical calculations. I can get the solar longitudes, new moons, etc. I.e., I got the minimum to implement a chinese calendar.
Now I'm ready to think about interfaces! Normally I would actually go and come up with interfaces myself, as it's part of development that I enjoy the most, but this particular topic is something that I'm completely ignorant about... I did read up on the material enough for me to implement the calculations, but I really need your help for this. I uploaded the mess that I have so far here: http://www.wafu.ne.jp/~daisuke/Astro-LuniSolar-0.07.tar.gz. It is currently just a straight port of what's in Calendrical Calculations, Yes, I know that a lot of redundunt or weird things exist. No, I usually don't code like this, and yes, I *will* fix them. For now I just needed to get the calculations correct. Anyway, here's what I got so far with the Astro:: stuff: Astro::Sun - stuff related to solar position Astro::Moon - stuff related to lunar position Astro::Common - common calculation utilities Astro::Earth::Location - simple structure to store latitude/longitude, etc. Astro::BigFloat - Wrapper to Math::BigFloat to allow toggling on/off the use of Math::BigFloat I by no means declare that these are good names: I used them just so I could roughly divide things up. Please suggest any ideas you might have. Here are some points that I'm kind of pondering about: - naming. - better organization - usage? is a plain procedural interface ok? use Astro::Sun qw(solar_longitude); my $degrees = solar_longitude($dt); - I think Astro::Common can be separated out into smaller packages. - when structure is settled, optimize a bit. Once I get the idea of how to organize these modules, I will polish them up, and bring them up again... I'll get into DateTime::Calendar::Chinese and what not in a separete thread. I'd like to get the underlying components more or less settled first. TIA, --d
