Subject: Re: bug#61460: 30.0.50; Calendar shows eclipse for quarter moon

From: Ulrich Müller <[email-masked]>
Date: Thu, 16 Feb 2023 21:26:24 +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?= <[email-masked]>
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