comparison lisp/calendar/lunar.el @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 0d8b17d428b5
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 ;;; lunar.el --- calendar functions for phases of the moon 1 ;;; lunar.el --- calendar functions for phases of the moon
2 2
3 ;; Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005
4 ;; Free Software Foundation, Inc.
4 5
5 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7 ;; Maintainer: Glenn Morris <rgm@gnu.org>
6 ;; Keywords: calendar 8 ;; Keywords: calendar
7 ;; Human-Keywords: moon, lunar phases, calendar, diary 9 ;; Human-Keywords: moon, lunar phases, calendar, diary
8 10
9 ;; This file is part of GNU Emacs. 11 ;; This file is part of GNU Emacs.
10 12
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details. 21 ;; GNU General Public License for more details.
20 22
21 ;; You should have received a copy of the GNU General Public License 23 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the 24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02111-1307, USA. 26 ;; Boston, MA 02110-1301, USA.
25 27
26 ;;; Commentary: 28 ;;; Commentary:
27 29
28 ;; This collection of functions implements lunar phases for calendar.el and 30 ;; This collection of functions implements lunar phases for calendar.el and
29 ;; diary.el. 31 ;; diary.el.
36 38
37 ;; The author would be delighted to have an astronomically more sophisticated 39 ;; The author would be delighted to have an astronomically more sophisticated
38 ;; person rewrite the code for the lunar calculations in this file! 40 ;; person rewrite the code for the lunar calculations in this file!
39 41
40 ;; Technical details of all the calendrical calculations can be found in 42 ;; Technical details of all the calendrical calculations can be found in
41 ;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 43 ;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
42 ;; Cambridge University Press (1997). 44 ;; and Nachum Dershowitz, Cambridge University Press (2001).
43 45
44 ;; Comments, corrections, and improvements should be sent to 46 ;; Comments, corrections, and improvements should be sent to
45 ;; Edward M. Reingold Department of Computer Science 47 ;; Edward M. Reingold Department of Computer Science
46 ;; (217) 333-6733 University of Illinois at Urbana-Champaign 48 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
47 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue 49 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
48 ;; Urbana, Illinois 61801 50 ;; Urbana, Illinois 61801
49 51
50 ;;; Code: 52 ;;; Code:
53
54 (defvar date)
55 (defvar displayed-month)
56 (defvar displayed-year)
51 57
52 (if (fboundp 'atan) 58 (if (fboundp 'atan)
53 (require 'lisp-float-type) 59 (require 'lisp-float-type)
54 (error "Lunar calculations impossible since floating point is unavailable")) 60 (error "Lunar calculations impossible since floating point is unavailable"))
55 61
393 (+ (calendar-absolute-from-gregorian (car adj)) 399 (+ (calendar-absolute-from-gregorian (car adj))
394 (/ (car (cdr adj)) 24.0)))))) 400 (/ (car (cdr adj)) 24.0))))))
395 401
396 (provide 'lunar) 402 (provide 'lunar)
397 403
404 ;;; arch-tag: 72f0b8a4-7bcc-4a1b-b67a-ff53c4a1d222
398 ;;; lunar.el ends here 405 ;;; lunar.el ends here