Function: eclipse-check

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

Signature

(eclipse-check MOON-LAT PHASE)

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 eclipse-check (moon-lat phase)
  (let* ((moon-lat (* (/ float-pi 180) moon-lat))
         ;; For positions near the ascending or descending node,
         ;; calculate the absolute angular distance from that node.
         (moon-lat (abs (- moon-lat (* (floor (/ moon-lat float-pi))
                                       float-pi))))
         (moon-lat (if (> moon-lat 0.37) ; FIXME (* 0.5 float-pi)
                       (- float-pi moon-lat)
                     moon-lat))
         (phase-name (cond ((= phase 0) "Solar")
                           ((= phase 2) "Lunar")
                           (t ""))))
    (cond ((string= phase-name "")
	   "")
	  ((< moon-lat 2.42600766e-1)
	   (concat "** " phase-name " Eclipse **"))
	  ((< moon-lat 0.37)
	   (concat "** " phase-name " Eclipse possible **"))
	  (t
	   ""))))