Astro:...nation(3pm)

πŸ“¦ version 1.26, in alpine 3.24

πŸ’– 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_MOON or $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:

  1. New Moon
  2. First Quarter
  3. Full Moon
  4. Last Quarter
  5. 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-degrees
  • moon β€” 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 (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