;ELC ;;; compiled by reingold@albert.gnu.ai.mit.edu on Fri Jun 3 16:22:52 1994 ;;; from file /gd/gnu/emacs/19.0/lisp/solar.el ;;; emacs version 19.25.2. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/solar.el' was compiled for Emacs 19")) (byte-code "! !!!" [fboundp atan require lisp-float-type error "Solar calculations impossible since floating point is unavailable." cal-dst] 2) (defvar calendar-time-display-form (quote (12-hours ":" minutes am-pm (if time-zone " (") time-zone (if time-zone ")"))) "\ *The pseudo-pattern that governs the way a time of day is formatted. A pseudo-pattern is a list of expressions that can involve the keywords `12-hours', `24-hours', and `minutes', all numbers in string form, and `am-pm' and `time-zone', both alphabetic strings. For example, the form '(24-hours \":\" minutes (if time-zone \" (\") time-zone (if time-zone \")\")) would give military-style times like `21:07 (UTC)'.") (defvar calendar-latitude nil "\ *Latitude of `calendar-location-name' in degrees, + north, - south. For example, 40.7 for New York City. It may not be a good idea to set this in advance for your site; if there may be users running Emacs at your site who are physically located elsewhere, they would get the wrong value and might not know how to override it.") (defvar calendar-longitude nil "\ *Longitude of `calendar-location-name' in degrees, + east, - west. For example, -74.0 for New York City. It may not be a good idea to set this in advance for your site; if there may be users running Emacs at your site who are physically located elsewhere, they would get the wrong value and might not know how to override it.") (defvar calendar-location-name (quote (let ((float-output-format "%.1f")) (format "%s%s, %s%s" (abs calendar-latitude) (if (> calendar-latitude 0) "N" "S") (abs calendar-longitude) (if (> calendar-longitude 0) "E" "W")))) "\ *Expression evaluating to name of `calendar-longitude', calendar-latitude'. Default value is just the latitude, longitude pair.") (defvar solar-n-hemi-seasons (quote ("Vernal Equinox" "Summer Solstice" "Autumnal Equinox" "Winter Solstice")) "\ List of season changes for the northern hemisphere.") (defvar solar-s-hemi-seasons (quote ("Autumnal Equinox" "Winter Solstice" "Vernal Equinox" "Summer Solstice")) "\ List of season changes for the southern hemisphere.") (defalias 'solar-setup #[nil " !\f!?!" [beep calendar-longitude solar-get-number "Enter longitude (decimal fraction; + east, - west): " calendar-latitude "Enter latitude (decimal fraction; + north, - south): " calendar-time-zone "Enter difference from Coordinated Universal Time (in minutes): "] 2 "\ Prompt user for latitude, longitude, and time zone."]) (defalias 'solar-get-number #[(prompt) " \"˜? !)" [read-string prompt "" x string-to-int] 4 "\ Return a number from the minibuffer, prompting with PROMPT. Returns nil if nothing was entered."]) (byte-code "\"\"\"" [defalias solar-sin-degrees #[(x) " _!" [sin x .017453292519943295] 3] solar-cosine-degrees #[(x) " _!" [cos x .017453292519943295] 3] solar-tangent-degrees #[(x) " _!" [tan x .017453292519943295] 3]] 3) (defalias 'solar-xy-to-quadrant #[(x y) "V\nVÇć\nVŇƇ" [x 0 y 1 4 2 3] 2 "\ Determines the quadrant of the point X, Y."]) (defalias 'solar-degrees-to-quadrant #[(angle) "\n\"\"T" [floor mod angle 360 90] 4 "\ Determines the quadrant of ANGLE."]) (defalias 'solar-arctan #[(x quad) " !_\fŚ \\+\fǚ \\+\fȚ* \\+ )" [atan x 57.295779513082323 deg quad 2 180 3 4 360] 2 "\ Arctangent of X in quadrant QUAD."]) (byte-code "\"\"" [defalias solar-arccos #[(x) "\n_Z! \n\n \"\")" [sqrt 1 x y solar-arctan solar-xy-to-quadrant] 5] solar-arcsin #[(y) "\n_Z!\n \n\"\")" [sqrt 1 y x solar-arctan solar-xy-to-quadrant] 5]] 3) (defconst solar-earth-inclination 23.441884000000002 "\ Inclination of earth's equator to its solar orbit in degrees.") (defconst solar-cos-inclination (solar-cosine-degrees solar-earth-inclination) "\ Cosine of earth's inclination.") (defconst solar-sin-inclination (solar-sin-degrees solar-earth-inclination) "\ Sine of earth's inclination.") (defconst solar-earth-orbit-eccentricity .016718 "\ Eccentricity of orbit of the earth around the sun.") (byte-code "\"\"" [defalias solar-degrees-to-hours (macro . #[(deg) " E" [/ deg 15.0] 3]) solar-hours-to-days (macro . #[(hour) " E" [/ hour 24.0] 3])] 3) (defalias 'solar-longitude-of-sun #[(day) "_Z !_ \\!_\\\\\\\")" [day .98559999999999999 3.2890000000000001 mean-anomaly mod solar-sin-degrees 1.916 .02 282.63400000000001 360] 6 "\ Longitude of the sun at DAY in the year."]) (defalias 'solar-right-ascension #[(longitude) " !_ !\"ť" [solar-arctan solar-cos-inclination solar-tangent-degrees longitude solar-degrees-to-quadrant 15.0] 4 "\ Right ascension of the sun, given its LONGITUDE."]) (defalias 'solar-declination #[(longitude) " !_!" [solar-arcsin solar-sin-inclination solar-sin-degrees longitude] 4 "\ Declination of the sun, given its LONGITUDE."]) (defalias 'solar-sunrise #[(date) "@A@AA@\n S_\\ V> _\\ɥZ ǦU> ˦U; ̦U> T ,ϥZХ\\!!!ڥ\\!!!_Z!!_!X!Zϥ##\\_\\Z\"(ϥZ)\\*." [date month day year 31 day-of-year 2 4 23 10 0 100 400 6 calendar-longitude 15.0 24.0 approx-sunrise solar-longitude-of-sun solar-longitude-of-sun-at-sunrise solar-right-ascension solar-right-ascension-at-sunrise solar-declination solar-declination-at-sunrise solar-cosine-degrees 50.0 60.0 90 solar-sin-degrees calendar-latitude cos-local-sunrise abs 1 360 solar-arccos local-sunrise mod .065709999999999997 6.6219999999999999 24 local-mean-sunrise calendar-time-zone 60.0] 5 "\ Calculates the *standard* time of sunrise for Gregorian DATE. Calculation is for location given by `calendar-latitude' and `calendar-longitude'. Returns a decimal fraction of hours. Returns nil if the sun does not rise at that location on that day."]) (defalias 'solar-sunset #[(date) "@A@AA@\n S_\\ V> _\\ɥZ ǦU> ˦U; ̦U> T ,ϥZХ\\!!!ڥ\\!!!_Z!!_!X!ϥ\"\"\\_\\Z\"'ϥZ(\\*." [date month day year 31 day-of-year 2 4 23 10 0 100 400 18 calendar-longitude 15.0 24.0 approx-sunset solar-longitude-of-sun solar-longitude-of-sun-at-sunset solar-right-ascension solar-right-ascension-at-sunset solar-declination solar-declination-at-sunset solar-cosine-degrees 50.0 60.0 90 solar-sin-degrees calendar-latitude cos-local-sunset abs 1 solar-arccos local-sunset mod .065709999999999997 6.6219999999999999 24 local-mean-sunset calendar-time-zone 60.0] 5 "\ Calculates the *standard* time of sunset for Gregorian DATE. Calculation is for location given by `calendar-latitude' and `calendar-longitude'. Returns a decimal fractions of hours. Returns nil if the sun does not set at that location on that day."]) (defalias 'solar-adj-time-for-dst #[(date time &optional style) "AA@AA@S@A@AA@\f S_\\ VN _\\ʥZ ȦUN ̦UI ͦUNT,\n_\nȥ\n̥[\nͥ\\\\\\\\)_!ҥ\\!AA@S!@!A@!AA@\f S_\\ V _\\ʥZ ȦU ̦U ͦUT,\n_\nȥ\n̥[\nͥ\\\\\\\\)ץ\\[!AA@S!@!A@!AA@\f S_\\ V> _\\ʥZ ȦU> ̦U9 ͦU>T,\n_\nȥ\n̥[\nͥ\\\\\\\\)Zܥ\\=?=WXWWWXX?W!\"#$!奂\\!!!Z_$E." [date year prior-years month day 31 day-of-year 2 4 23 10 0 100 400 365 round time 60 1440.0 rounded-abs-date calendar-daylight-savings-starts eval calendar-daylight-savings-starts-time 1440.0 dst-starts calendar-daylight-savings-ends calendar-daylight-savings-ends-time calendar-daylight-time-offset 1440.0 dst-ends style standard daylight dst calendar-daylight-time-zone-name calendar-standard-time-zone-name time-zone 1440.0 calendar-gregorian-from-absolute truncate 24.0] 7 "\ Adjust decimal fraction standard TIME on DATE to account for dst. Returns a list (date adj-time zone) where `date' and `time' are the values adjusted for `zone'; here `date' is a list (month day year), `time' is a decimal fraction time, and `zone' is a string. Optional parameter STYLE forces the result time to be standard time when its value is 'standard and daylight savings time (if available) when its value is 'daylight. Conversion to daylight savings time is done according to `calendar-daylight-savings-starts', `calendar-daylight-savings-ends', `calendar-daylight-savings-starts-time', `calendar-daylight-savings-ends-time', and `calendar-daylight-savings-offset'."]) (defalias 'solar-time-string #[(time time-zone) " _!¥ ¦\" \\ɦT\"\n Y'˂( \"#." [round time 60 24-hours format "%02d" minutes "%d" 11 12 12-hours "pm" "am" am-pm mapconcat eval calendar-time-display-form ""] 5 "\ Printable form for decimal fraction TIME on DATE. Format used is given by `calendar-time-display-form'."]) (defalias 'solar-sunrise-sunset #[(date) " ! \n\" ! \"\n- \f@\"-\fA\"P.G @\"GA\"PH!$," [solar-sunrise date rise solar-adj-time-for-dst adj-rise solar-sunset set adj-set format "%s, %s at %s" calendar-date-equal "Sunrise " apply solar-time-string "No sunrise" "sunset " "no sunset" eval calendar-location-name] 7 "\ String giving local times of sunrise and sunset on Gregorian DATE."]) (defalias 'solar-apparent-longitude-of-sun #[(date) "AA@S@A@AA@ \nS_\\\nVI\n_\\ʥZ\fȦUI\f̦UD\fͦUIT, _ ȥ ̥[ ͥ\\\\\\\\) \nS_\\\nV\n_\\ʥZ\fȦU\f̦U\fͦUT, _ ȥ ̥[ ͥ\\\\\\\\)Zӥ___\\\\______\\\\\\___\\\\!__\\\\!__!_\\\\&&\\'_\\*'*!_\\\\." [date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 1899 1 .5 1900 36525 time 36000.768920000002 .00030249999999999999 279.69668000000001 l 35999.049749999998 -.00014999999999999996 -3.3000000000000003e-006 358.47582999999997 m -.0047889999999999997 -1.3999999999999999e-005 1.9194599999999999 solar-sin-degrees -.0001 .020094000000000003 3 .00029300000000000006 c L -1934.1420000000001 259.18000000000001 omega -.00479 -.0056899999999999995] 8 "\ Apparent longitude of the sun on Gregorian DATE."]) (defalias 'solar-ephemeris-correction #[(year) "Z¥_ __\\\\)" [year 1900 100.0 T 1.2053 .4992 .40999999999999996] 5 "\ Difference in minutes between Ephemeris time and UTC in YEAR. Value is only an approximation."]) (defalias 'solar-equinoxes/solstices #[(k year) "_\\ EV=!\"_Z!_@A@\\ E@A@ѥ !ӥ[\\\\ E+" [k 3 21 year nil 1000 correction app date 1e-005 mod solar-apparent-longitude-of-sun 360 solar-sin-degrees 90 58 calendar-time-zone 1440.0 solar-ephemeris-correction 1440.0] 5 "\ Date of equinox/solstice K for YEAR. K=0, spring equinox; K=1, summer solstice; K=2, fall equinox; K=3, winter solstice. Accurate to within several minutes."]) (defalias 'sunrise-sunset #[(&optional arg) "W \f  W%\f(!W3 6!WA D!WP s ! Vb҂c\f!\fVpԂq%) W Uׂ W \" \"WWW \"\"!$\"$#&!(&G X&!\"$Q!( /\f\f!!.\f" [arg 1 16 calendar-latitude calendar-longitude calendar-time-zone solar-setup solar-get-number "Enter longitude (decimal fraction; + east, - west): " "Enter latitude (decimal fraction; + north, - south): " "Enter difference from Coordinated Universal Time (in minutes): " calendar-location-name "%.1f" float-output-format format "%s%s, %s%s" abs 0 "N" "S" "E" "W" calendar-standard-time-zone-name "UTC" "UTC%dmin" "UTC+%dmin" calendar-daylight-savings-starts calendar-daylight-savings-ends 4 calendar-current-date calendar-read-date date calendar-date-string t date-string solar-sunrise-sunset time-string "%s: %s" msg one-window-p one-window frame-width message "*temp*" princ "\n" substitute-command-keys pop-up-windows "Type \\[delete-other-windows] to remove temp window." "Type \\[switch-to-buffer] RET to remove temp window." "Type \\[switch-to-buffer-other-window] RET to restore old contents of temp window."] 7 "\ Local time of sunrise and sunset for today. Accurate to +/- 2 minutes. If called with an optional prefix argument, prompt for date. If called with an optional double prefix argument, prompt for longitude, latitude, time zone, and date, and always use standard time. This function is suitable for execution in a .emacs file." "p"]) (defalias 'calendar-sunrise-sunset #[nil "\f \f\n !ʼn#!#)" [calendar-latitude calendar-longitude calendar-time-zone solar-setup calendar-cursor-to-date t date message "%s: %s" calendar-date-string solar-sunrise-sunset] 6 "\ Local time of sunrise and sunset for date under cursor. Accurate to +/- 2 minutes." nil]) (defalias 'diary-sunrise-sunset #[nil "\f \f\n !" [calendar-latitude calendar-longitude calendar-time-zone solar-setup solar-sunrise-sunset date] 2 "\ Local time of sunrise and sunset as a diary entry. Accurate to +/- 2 minutes."]) (defalias 'diary-sabbath-candles #[nil "\f \f\n \fAA@S\f@\fA@\fAA@S_\\\nVb\n_\\ΥZ\n̦UbЦU]ѦUb\nT\n\n, _ ̥ Х[ ѥ\\\\\\\\)ӦU\f!\f٥Z\"\f@\"A\"\"*" [calendar-latitude calendar-longitude calendar-time-zone solar-setup date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 7 5 solar-sunset sunset solar-adj-time-for-dst 18.0 60.0 light calendar-date-equal format "%s Sabbath candle lighting" apply solar-time-string] 7 "\ Local time of candle lighting diary entry--applies if date is a Friday. No diary entry if there is no sunset on that date."]) (defalias 'solar-equinoxes-solstices #[nil " \n_ ŦUǂ! ŦU Ƃ!\\\\\\\nĦT\nĥ) <\f=\f F O [ \\ ťS\n\"tWA@@!AA@E!Z_\"@8A\"#. DC" [displayed-month displayed-year y m 12 3 1 -1 2 0 macro-y calendar-time-zone calendar-standard-time-zone-name "UTC" calendar-daylight-savings-starts calendar-daylight-savings-ends k solar-equinoxes/solstices date calendar-latitude s-hemi day solar-adj-time-for-dst truncate 24 adj format "%s %s" solar-s-hemi-seasons solar-n-hemi-seasons apply solar-time-string] 8 "\ Date and time of equinoxes and solstices, if visible in the calendar window. Requires floating point."]) (provide (quote solar))