;;; compiled by rms@mole.gnu.ai.mit.edu on Thu May 27 00:27:08 1993
;;; from file /home/fsf/rms/e19/lisp/solar.el
;;; emacs version 19.8.0.
;;; bytecomp version FSF 2.08
;;; optimization is on.

(byte-code "! ! !!" [fboundp atan require lisp-float-type error "Solar calculations impossible since floating point is unavailable." calendar] 2)
(defalias 'solar-setup #[nil " 	 ! !? !" [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 Universal Time (in minutes): "] 2 "\
Prompt user for latitude, longitude, and time zone."])
(defalias 'solar-get-number #[(prompt) "	\"\"? !)" [read-string prompt "" x string-equal string-to-int] 3 "\
Return a number from the minibuffer, prompting with PROMPT.
Returns nil if nothing was entered."])
(byte-code "MMM" [solar-sin-degrees #[(x) "\n\"!" [sin * x .017453292519943294892] 4] solar-cosine-degrees #[(x) "\n\"!" [cos * x .017453292519943294892] 4] solar-tangent-degrees #[(x) "\n\"!" [tan * x .017453292519943294892] 4]] 2)
(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) "\"\"!T" [truncate / solar-mod angle 360.0 90.0] 5 "\
Determines the quadrant of ANGLE."])
(defalias 'solar-arctan #[(x quad) "\n!\"\" \\2 \"# \\2 \"1 \\2 )" [* atan x 57.295779513082322865 deg equal quad 2 180 3 4 360] 3 "\
Arctangent of X in quadrant QUAD."])
(byte-code "MM" [solar-arccos #[(x) "\"Z!\"\"\")" [sqrt 1 * x y solar-arctan / solar-xy-to-quadrant] 5] solar-arcsin #[(y) "\"Z!\"\"\")" [sqrt 1 * y x solar-arctan / solar-xy-to-quadrant] 5]] 2)
(defalias 'solar-mod #[(x y) "	\n\"V \n\\ )" [% x y v 0] 3 "\
Returns X mod Y; value is *always* non-negative."])
(defconst solar-earth-inclination 23.44188400000000172 "\
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 .016717999999999999972 "\
Eccentricity of orbit of the earth around the sun.")
(byte-code "MM" [solar-degrees-to-hours (macro . #[(deg) "	E" [/ deg 15] 3]) solar-hours-to-days (macro . #[(hour) "	E" [/ hour 24] 3])] 2)
(defalias 'solar-longitude-of-sun #[(day) "	\"Z!\"\\!!\"\\\\\\\")" [* day .98559999999999998721 3.2890000000000001457 mean-anomaly solar-mod solar-sin-degrees 1.9160000000000000142 .02 282.63400000000001455 360] 8 "\
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] 6 "\
Right ascension of the sun, given its LONGITUDE."])
(defalias 'solar-declination #[(longitude) "\n!\"!" [solar-arcsin * solar-sin-inclination solar-sin-degrees longitude] 5 "\
Declination of the sun, given its LONGITUDE."])
(defalias 'solar-sunrise #[(date) "@A@AA@\n	S\"\\	VI 	\"\\\"Z\"U; \"UD \"UI T,\"Z\"\\!!!\"\\!! !\"Z! !\"\"!\"W \"[ \")X !!Z\"&&\\\"\\Z\"*\"Z+\"\\*." [date month day year * 31 day-of-year 2 / 4 23 10 % 0 100 400 6 calendar-longitude 15 24 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 number 1 360 solar-arccos local-sunrise solar-mod .0657099999999999973 6.6219999999999998863 local-mean-sunrise calendar-time-zone 60.0] 7 "\
Calculates the *standard* time of sunrise for Gregorian DATE 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\"\\	VI 	\"\\\"Z\"U; \"UD \"UI T,\"Z\"\\!!!\"\\!! !\"Z! !\"\"!\"W \"[ \")X !!\"%%\\\"\\Z\")\"Z*\"\\*." [date month day year * 31 day-of-year 2 / 4 23 10 % 0 100 400 18 calendar-longitude 15 24 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 number 1 solar-arccos local-sunset solar-mod .0657099999999999973 6.6219999999999998863 local-mean-sunset calendar-time-zone 60.0] 7 "\
Calculates the *standard* time of sunset for Gregorian DATE 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-time-string #[(time date) "AA@@A@AA@@A@AA@\nS\"\\VZ \"\\\"Z	\"UL 	\"UU 	\"UZ T,	S\"	S\"	S\"[	S\"\\\\\\\\+!@!A@!AA@!@!A@!AA@\nS\"\\V \"\\\"Z	\"U 	\"U 	\"U T,	S\"	S\"	S\"[	S\"\\\\\\\\+X!@!A@!AA@!@!A@!AA@\nS\"\\Vv\"\\\"Z	\"Uh	\"Uq	\"UvT,	S\"	S\"	S\"[	S\"\\\\\\\\+WT!Z\"!UTU͂\"VZU\"#Y&\"(#." [date year day month * 31 day-of-year 2 / 4 23 10 % 0 100 400 365 abs-date calendar-daylight-savings-starts calendar-daylight-savings-ends eval dst time calendar-daylight-time-zone-name calendar-standard-time-zone-name time-zone truncate 24-hours round 60 minutes format "%02d" "%d" 12 12-hours "pm" "am" am-pm mapconcat calendar-time-display-form ""] 9 "\
Printable form for decimal fraction standard TIME on DATE.
Format used is given by `calendar-time-display-form'.  Converted to daylight
savings time according to `calendar-daylight-savings-starts' and
`calendar-daylight-savings-ends', if those variables are not nil."])
(defalias 'solar-sunrise-sunset #[(date) "	!	! 	\"P % 	\"P& !$*" [solar-sunrise date solar-sunset set rise format "%s, %s at %s" "Sunrise " 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) "	@	A@	AA@	@	A@	AA@S\"\\VV \"\\\"Z\n\"UH \n\"UQ \n\"UV T,\nS\"\nS\"\nS\"[\nS\"\\\\\\\\+S\"\\V \"\\\"Z\n\"U \n\"U \n\"U T,\nS\"\nS\"\nS\"[\nS\"\\\\\\\\+Z\"\"#\\\\\"#$\\\\\\ŉ\"#\\\\!\"ŉ\"\\\\!!\"\"!\"\\\\''\\(\"\\+(+!\"\\\\." [/ date year day month * 31 day-of-year 2 4 23 10 % 0 100 400 365 1 .5 1900 36525 time 36000.768920000002254 .00030249999999999999112 279.69668000000001484 l 35999.049749999998312 -.00014999999999999995559 -3.3000000000000002665e-006 358.47582999999997355 m -.0047889999999999997016 -1.3999999999999999112e-005 1.919459999999999944 solar-sin-degrees -.0001 .02009400000000000297 3 .0002930000000000000604 c L -1934.1420000000000528 259.18000000000000682 omega -.0047900000000000000355 -.0056899999999999995026] 10 "\
Apparent longitude of the sun on Gregorian DATE."])
(defalias 'solar-ephemeris-correction #[(year) "	Z\"\"#\\\\)" [/ year 1900 100.0 T * 1.205300000000000038 .49919999999999999929 .40999999999999996447] 5 "\
Difference in minutes between Ephemeris time an Universal time in YEAR.
Value is only an approximation."])
(defalias 'solar-equinoxes/solstices #[(k year) "	\"\\EV= !\"	\"Z!\"@A@\\E @A@\"!\"[\\\\E*" [* k 3 21 year 1000 correction date 1e-005 solar-mod solar-apparent-longitude-of-sun 360.0 app solar-sin-degrees 90 58 / calendar-time-zone 1440.0 solar-ephemeris-correction 1440.0] 6 "\
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 \n    W \" !W- \n0 !W; > !WJ \n \nW^ [` )\nVk тl W{ [} )V ӂ %)\nW  U ւ W \" \"W W W    \"!!#!##%!'%G X%!&!#Q!'#.$$!!." [arg 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 Universal Time (in minutes): " calendar-location-name "%.1f" float-output-format format "%s%s, %s%s" number 0 "N" "S" "E" "W" calendar-standard-time-zone-name "UT" "UT%dmin" "UT+%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 screen-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."] 8 "\
Local time of sunrise and sunset for today.  Accurate to +/- 2 minutes.
If called with an optional prefix argument, prompts for date.

If called with an optional double prefix argument, prompts for longitude,
latitude, time zone, and date.

This function is suitable for execution in a .emacs file." "p"])
(defalias 'calendar-sunrise-sunset #[nil " 	 \n    !!!" [calendar-latitude calendar-longitude calendar-time-zone solar-setup message solar-sunrise-sunset calendar-cursor-to-date error "Cursor is not on a date!"] 4 "\
Local time of sunrise and sunset for date under cursor.
Accurate to +/- 2 minutes." nil])
(defalias 'diary-sunrise-sunset #[nil " 	 \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 " 	 \n  @A@AA@@A@AA@S\"\\Vr \"\\\"Z\"Uc \"Um \"Ur T,S\"S\"S\"[S\"\\\\\\\\+\"U ! \"Z \"\"*" [calendar-latitude calendar-longitude calendar-time-zone solar-setup % date year day month * 31 day-of-year 2 / 4 23 10 0 100 400 365 7 5 solar-sunset sunset 18.0 60.0 light format "%s Sabbath candle lighting" solar-time-string] 9 "\
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 'calendar-holiday-function-solar-equinoxes-solstices #[nil "\n\"		\"U ɂ$ 	\"U# Ȃ$ \\\\\\\"T\")B C L U a b 	\"S\"A@!Z\"@!AA@EU ܂ U ݂ U ނ U \"#.DC" [displayed-month m displayed-year y * 12 % 3 1 -1 2 0 macro-y / calendar-time-zone calendar-standard-time-zone-name "UT" calendar-daylight-savings-starts calendar-daylight-savings-ends k solar-equinoxes/solstices date day truncate 24 time format "%s %s" "Vernal Equinox" "Summer Solstice" "Fall Equinox" "Winter Solstice" solar-time-string] 8 "\
Date and time of equinoxes and solstices, if visible in the calendar window.
Requires floating point."])
(provide (quote solar))
