unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Eli Zaretskii <eliz@gnu.org>, 61460@debbugs.gnu.org
Subject: bug#61460: 30.0.50; Calendar shows eclipse for quarter moon
Date: Thu, 16 Feb 2023 21:26:24 +0100	[thread overview]
Message-ID: <umt5d9x1r@gentoo.org> (raw)
In-Reply-To: <87ttzoo6px.fsf@web.de> (Michael Heerdegen's message of "Tue, 14 Feb 2023 11:56:58 +0100")

>>>>> On Tue, 14 Feb 2023, Michael Heerdegen wrote:

>> Next round: The following simplifies the calculation and IMHO makes
>> it much easier to understand. Results are identical, and tests pass.

> Yes, thanks.  I want to suggest to get rid of the successive rebinding
> to the variable `moon-lat' and use a different name (`node-distance'
> maybe?) since that calculation is not just a simple conversion of units.

>> Alternatively, we could leave the result in degrees (as all other
>> calculations in lunar.el are in degrees) and change the values in the
>> final cond to 13.9 and 21.2 degrees. This would also get rid of the
>> excessive number of digits.

> Good idea.  The conversion to radians is a bit artificial and not really
> useful, just harder to read.

Pushed to master, including your suggestion (I went for "node-dist").


I think the last open question is what values we should use as limits
for "certain" and "possible" eclipses? A calculation of these limits can
be found here (complete text on Google Books):

  William Chauvenet, "A manual of spherical and practical astronomy",
  Vol. I, Lippincott & Co., London, 1863.

On page 439: "a solar eclipse is certain if at new moon β < 1°23'15",
impossible if β > 1°34'53", and doubtful between these limits."

And on page 543: "a lunar eclipse is certain if at full moon β < 52'4",
impossible if β > 63'53", and doubtful between these limits."

These limits are given in terms of ecliptic latitude β, which can be
converted to the argument of latitude u using the same spherical
triangle as above (in message #68):

  sin Δu = sin β / sin i

Using the minimum and maximum values of the lunar orbit's inclination
i_min = 4°57'2" and i_max = 5°20'6" (see table on page 438), I get the
following limits for Δu:

  Solar eclipse certain:  Δu < 15.10°
  Solar eclipse possible: Δu < 18.65°
  Lunar eclipse certain:  Δu <  9.37°
  Solar eclipse possible: Δu < 12.43°

(These are close to the values given by Peter Duffet-Smith, "Practical
astronomy with your calculator", 3rd ed., Cambridge University Press,
1991, page 156: Solar eclipse certain: 15°31', possible: 18°31'; lunar
eclipse certain: 9°30', possible: 12°15'.)

However, if I put these limits into the comparisons in eclipse-check,
then it misses the partial lunar eclipse on 2023-10-28 (I haven't
checked any others, but if it is wrong in this year, then it is probably
wrong in more cases). I suspect that the calculations in lunar-phase are
not precise enough.

Also, I believe that I have found the source of the current limits:

  Jean Meeus, "Astronomical algorithms", 1st ed., Willmann-Bell,
  Richmond, VA, 1991.

This happens to be one of the references mentioned in the header of
lunar.el, therefore the limits are likely to be consistent with the
precision of the other calculations.

On page 350 it says: "If F [the argument of latitude] differs from the
nearest multiple of 180° by less than 13°.9, then there is certainly an
eclipse; if the difference is larger than 21°.0, there is no eclipse;
between these two values, the eclipse is uncertain at this stage and the
case must be examined further."

tl;dr I suggest that we leave the values as-is, except for a small
adjustment from 21.2 to 21.0, as in the patch included below. If there
aren't any nobjections, I'm going to push this to master.

@Michael: Can this bug be closed then?


From 431c60084dade55acd0d407fff1cdfb2352a3d91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
Date: Thu, 16 Feb 2023 20:09:22 +0100
Subject: [PATCH] ; * lisp/calendar/lunar.el (eclipse-check): Adjust upper
 limit.

---
 lisp/calendar/lunar.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el
index 1f827ca34b0..8fb5c89c057 100644
--- a/lisp/calendar/lunar.el
+++ b/lisp/calendar/lunar.el
@@ -164,8 +164,9 @@ remainder mod 4 gives the phase: 0 new moon, 1 first quarter, 2 full moon,
                            (t ""))))
     (cond
      ((string= phase-name "") "")
+     ;; Limits 13.9° and 21.0° from Meeus (1991), page 350.
      ((< node-dist 13.9) (concat "** " phase-name " Eclipse **"))
-     ((< node-dist 21.2) (concat "** " phase-name " Eclipse possible **"))
+     ((< node-dist 21.0) (concat "** " phase-name " Eclipse possible **"))
      (t ""))))
 
 (defconst lunar-cycles-per-year 12.3685 ; 365.25/29.530588853
-- 
2.39.2





  reply	other threads:[~2023-02-16 20:26 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12 19:57 bug#61460: 30.0.50; Calendar shows eclipse for quarter moon Ulrich Mueller
2023-02-12 20:07 ` Ulrich Müller
2023-02-12 20:19   ` Eli Zaretskii
2023-02-12 21:13     ` Ulrich Mueller
2023-02-13  3:24       ` Eli Zaretskii
2023-02-13  3:25   ` Michael Heerdegen
2023-02-13  4:52     ` Michael Heerdegen
2023-02-13  5:13     ` Michael Heerdegen
2023-02-13  6:01       ` Michael Heerdegen
2023-02-13  7:28       ` Ulrich Mueller
2023-02-13  8:13         ` Michael Heerdegen
2023-02-13  8:52           ` Michael Heerdegen
2023-02-13  9:34             ` Ulrich Mueller
2023-02-13 10:04               ` Michael Heerdegen
2023-02-13 13:03                 ` Eli Zaretskii
2023-02-13 13:30                   ` Ulrich Mueller
2023-02-13 14:05                     ` Eli Zaretskii
2023-02-14  5:30               ` Michael Heerdegen
2023-02-14  7:59                 ` Ulrich Mueller
2023-02-14  9:15                   ` Michael Heerdegen
2023-02-14 10:22                     ` Ulrich Müller
2023-02-14 10:56                       ` Michael Heerdegen
2023-02-16 20:26                         ` Ulrich Müller [this message]
2023-02-17  5:25                           ` Michael Heerdegen
2023-02-17  7:03                             ` Ulrich Müller
2023-02-17  7:20                               ` Michael Heerdegen
2023-02-18  5:53                                 ` Michael Heerdegen
2023-02-18  8:56                                   ` Ulrich Mueller
2023-02-18  9:16                                     ` Michael Heerdegen
2023-02-21 15:15                                       ` Michael Heerdegen
2023-02-22  9:00                                         ` Ulrich Mueller
2023-02-22  9:45                                           ` Andreas Schwab
2023-02-22 10:03                                           ` Michael Heerdegen
2023-02-22 11:32                                             ` Ulrich Mueller
2023-02-22 14:19                                               ` Michael Heerdegen
2023-02-22 15:46                                                 ` Ulrich Mueller
2023-02-22 16:26                                                   ` Michael Heerdegen
2023-02-25 16:13                                                     ` Michael Heerdegen
2023-02-14 13:31                       ` Eli Zaretskii
2023-02-14 10:49                     ` Ulrich Mueller
2023-02-13  6:21     ` Ulrich Mueller
2023-02-13  7:08       ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=umt5d9x1r@gentoo.org \
    --to=ulm@gentoo.org \
    --cc=61460@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).