|
NAMEDateTime::Astro - Functions For Astromical CalendarsDESCRIPTIONDateTime::Astro implements functions used in astronomical calendars, such as calculation of lunar longitudea and solar longitude.This module is best used in environments where a C compiler and the MPFR arbitrary precision math library is installed. It can fallback to using Math::BigInt, but that would pretty much render it useless because of its speed and loss of accuracy that may creep up while doing Perl to C struct conversions. DISCLAIMERThis module works, but there are several caveats you should be aware of:MPFR Is Required / PurePerl Version Not FunctionalThere /is/ a HALF BAKED Pure Perl implmentation bundled with this distribution, but at this point please consider it UNUSABLE. This sort of calculation requires the speed and efficiency of a C library anyway.As such, you HAVE to have MPFR installed correctly in your system. Please consult your local package manager, or http://mpfr.org Patches to make the pure perl version work better is always welcome. 17 solar terms are still off by ~ 5 minutesI've tried very hard to correctly calculate the solar term dates with this module, but I still get 17 instances in about 130 years worth of solar terms, where the dates are off by an average of about 5 minutes -- and these usually fall at right about midnight, causing day-based comparisons to be off by 1.I'm sure there's something that's causing a round off somwhere. If you're up to it, please see xt/101_solar_terms.t and see if you can fix it for me! FUNCTIONSBACKEND()Returns 'XS' or 'PP', noting the current backend.dt_from_moment($moment)Given a moment (days since rd + fractional seconds), returns a DateTime object in UTCdynamical_moment($moment)Computes the moment value from given moemnt, taking into account the ephemeris correction.dynamical_moment_from_dt($dt)Computes the moment value from a DateTime object, taking into account the ephemeris correction.ephemeris_correction($moment)Computes the ephemeris correction on a given momentgregorian_components_from_rd($rd_days)Computes year, month, date from RD valuegregorian_year_from_rd($rd_days)Computes year from RD valuejulian_centuries($dt)Computes the julian centuries for given DateTime objectjulian_centuries_from_moment($moment)Computes the julian centuries for given momentlunar_phase($dt)Computes the lunar phase for given DateTime objectlunar_phase_from_moment($moment)Computes the lunar phase for given momentpolynomial($x, ...)Computes the polynomical expression using $x as the variable. The left most argument is the constant, and each successive argument is the coefficient for the next power of $xymd_seconds_from_moment($moment)Computes the gregorian components (year, month, day) from the RD date, and the number of seconds from the fractional part.lunar_longitude($dt)Returns the Moon's longitude on the given date $dtlunar_longitude_from_moment($moment)Returns the Moon's longitude on the given moment $momentmoment($dt)Returns the date $dt expressed in momentnth_new_moon($n)Returns the $n-th new moon, in $moment.Currently the new moons dates are accurate to about within +/- 60 seconds of the actual new moon for modern dates. For older dates, the accuraccy degrades a bit to about +/- 5 minutes. new_moon_after($dt)new_moon_before($dt)solar_longitude($dt)Returns the Sun's longitude on the given date $dtsolar_longitude_from_moment($moment)Returns the Sun's longitude on the given moment $momentnew_moon_after_from_momentnew_moon_before_from_momentsolar_longitude_aftersolar_longitude_after_from_momentsolar_longitude_beforesolar_longitude_before_from_momentCONSTANTSMEAN_SYNODIC_MONTHMean time (in moment) between new moonsMEAN_TROPICAL_YEARMean time (in moment) between a full year (time for the Earth to go around the sun)LICENSEThis library is available under Artistic License v2, and is:Copyright (C) 2012 Daisuke Maki C<< <daisuke@endeworks.jp> >> AUTHORDaisuke Maki "<daisuke@endeworks.jp>"
Visit the GSP FreeBSD Man Page Interface. |