This was formerly posted as "AstroScript". Following the recommendations of djerius@github, I separated the astronomical code into an independent library, named after one of the authors of algorithms, Oliver Montenbruck, and placed it into
The main purpose is to calculate positions of the Sun, the Moon, and the planets with precision that is approximately the same as that found in astronomical yearbooks. Other modules contain time-related routines, coordinates conversions, calculation of the ecliptic obliquity and nutation, etc. Over time, the range of utility functions will grow.
Partially it overlaps some code which already exists in CPAN and elsewhere. For instance, there is a Perl wrapper for Swiss Ephemeris. Swiss Ephemeris is fast and precise C library. Unfortunately, it lacks portability and convenient license.
The present library is an attempt to find a middle-ground between precision on the one hand and compact, well organized code on the other. I tried to follow the best practices of modern Perl programming.
There are many astronomical libraries available in the public domain. While giving accurate results, they often suffer from lack of convenient API, documentation and maintainability. Most of the source code is written in C, C++ or Java, and not dynamic languages. So, it is not easy for a layman to customize them for her custom application, be it an online lunar calendar, horoscope or tool for amateur sky observations. This library is an attempt to find a middle-ground between precision on the one hand and compact, well organized code on the other.
Most of the calculations are based on "Astronomy On The Personal Computer" by O.Montenbruck, T.Phleger, Fourth Edition, Springer-Verlag, 2000.
The library includes:
AstroScript::MathUtils — Core mathematical routines. AstroScript::Time — Time-related routines. AstroScript::Ephemeris — Positions of celestial bodies. AstroScript::Angles — Some abstract points related to diurnal rotation of the Celestial Sphera: Ascendant, Midheaven, Vertex, East Point. AstroScript::CoCo — Coordinates conversions. AstroScript::Houses — Astrological houses, by the most used systems. AstroScript::Nutation — Nutation and obliquity of ecliptic.