Function: lunar-check-for-eclipse

lunar-check-for-eclipse is a byte-compiled function defined in lunar.el.gz.

Signature

(lunar-check-for-eclipse MOON-LAT PHASE)

Documentation

Check if a solar or lunar eclipse can occur for MOON-LAT and PHASE.

MOON-LAT is the argument of latitude. PHASE is the lunar phase:
0 new moon, 1 first quarter, 2 full moon, 3 last quarter.
Return a string describing the eclipse (empty if no eclipse).

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/lunar.el.gz
;; from "Astronomy with your Personal Computer", Subroutine Eclipse
;; Line 7000 Peter Duffett-Smith Cambridge University Press 1990
(defun lunar-check-for-eclipse (moon-lat phase)
  "Check if a solar or lunar eclipse can occur for MOON-LAT and PHASE.
MOON-LAT is the argument of latitude.  PHASE is the lunar phase:
0 new moon, 1 first quarter, 2 full moon, 3 last quarter.
Return a string describing the eclipse (empty if no eclipse)."
  (let* ((node-dist (mod moon-lat 180))
         ;; Absolute angular distance from the ascending or descending
         ;; node, whichever is nearer.
         (node-dist (min node-dist (- 180 node-dist)))
         (type (cond ((= phase 0) "Solar")
                     ((= phase 2) "Lunar"))))
    (cond ((not type) "")
          ;; Limits 13.9° and 21.0° from Meeus (1991), page 350.
          ((< node-dist 13.9) (concat "** " type " Eclipse **"))
          ((< node-dist 21.0) (concat "** " type " Eclipse possible **"))
          (t ""))))