Astro:...nation(3pm)
π NAME π
Okay so this is Astro::Montenbruck::Lunation, a User Contributed Perl Documentation page, and it is literally all about Lunar quarters. That's the whole assignment, bestie. π
π¦ SYNOPSIS π¦
Here is the vibe in code β copy it exactly, no cap:
use Astro::Montenbruck::Lunation qw/:all/;
# find instant of New Moon closest to 2019 Aug, 12
$jd = search_event([2019, 8, 12], $NEW_MOON);
# returns 2458696.63397517
# find, which lunar phase corresponds to Moon longitude of 9.926
# and Sun longitude of 316.527
$phase = lunar_phase(moon => 9.926, sun => 316.527);
# returns 'Waxing Crescent'
πΈ DESCRIPTION πΈ
This module searches lunar quarters, periodt. The algorithms are based on "Astronomy with your PC" by Peter Duffett-Smith, Second Edition, Cambridge University Press}, 1990. Iconic. β¨
π EXPORT π
Here is what you can pull in, bestie.
π CONSTANTS π
π PHASES π
$NEW_MOON$WAXING_CRESCENT$FIRST_QUARTER$WAXING_GIBBOUS$FULL_MOON$WANING_GIBBOUS$LAST_QUARTER$WANING_CRESCENT
π οΈ SUBROUTINES π οΈ
These functions are the main characters, fr fr.
π search_event(date => $arr, quarter => $scalar) π
This calculates the instant of the apparent lunar phase closest to the date you hand it. Slay. π
ποΈ Named Arguments ποΈ
dateβ array of year (astronomical, zero-based), month [1..12] and day, [1..31].quarterβ which quarter, one of:$NEW_MOON,$FIRST_QUARTER,$FULL_MOONor$LAST_QUARTER.
β¨ Returns β¨
In scalar context returns Standard Julian day of the event, dynamic time.
In list context:
- Standard Julian day of the event, dynamic time.
- Argument of latitude, arc-degrees. This value is required for detecting elipses.
ποΈ lunar_month($jd) ποΈ
Find lunar quarters around the given date. Bestie, it is giving full lunar-month mood board. π
ποΈ Arguments ποΈ
jdβ Standard Julian date
π« Returns π«
Array of 5 hashes, each hash representing a successive lunar quarter. Their order is always the same:
- New Moon
- First Quarter
- Full Moon
- Last Quarter
- The next New Moon
Each hash contains 3 elements:
typeβ One of the constants representing the main Quarter:$NEW_MOON,$FIRST_QUARTER,$FULL_MOON,$LAST_QUARTER.jdβ Standard Julian Date of the event,currentβ True if the the given date lies within the quarter.
π§ͺ Example π§ͺ
lunar_month(2459614.5) gives:
(
{
type => 'New Moon',
jd => 2459611.74248269, # time when the quarter starts
current => 1 # since 2459611.74248269 < 2459614.5 < 2459619.07819525, our date belongs to New Moon phase.
},
{
type => 'First Quarter',
current => 0,
jd => 2459619.07819525
},
{
type => 'Full Moon',
current => 0,
jd => 2459627.20811964
},
{
current => 0,
jd => 2459634.44073709'
type => 'Last Quarter'
},
{
current => 0,
type => 'New Moon',
jd => 2459641.23491532
}
);
π lunar_phase(sun => $decimal, moon => $decimal) π
Given Sun and Moon longitudes, detects a lunar phase. Vibe check complete. π¦
ποΈ Named Arguments ποΈ
sunβ longitude of the Sun, in arc-degreesmoonβ longitude of the Moon, in arc-degrees=back
π Returns π
In scalar context the phase name, one of the PHASES.
In list context:
- name of the phase.
- Moon age in arc-degrees
- Moon age in days
π AUTHOR π
Sergey Krushinsky, "<krushi at cpan.org>" π«Ά
π COPYRIGHT AND LICENSE π
Copyright (C) 2009-2022 by Sergey Krushinsky
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π¨ POD ERRORS π¨
Hey! The above document had some coding errors, which are explained below:
- Around line 310: You forgot a '=back' before '=head3'
- Around line 334: '=item' outside of any '=over'
- Around line 405: You forgot a '=back' before '=head3'
Signing off from the Astro::Montenbruck::Lunation page under perl v5.42.2, dated 2026-02-15. Go find your lunar quarters, bestie π
πβ¨
π¦ where this page comes from
- alpine 3.24: perl-astro-montenbruck-doc 1.26-r1 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms