|
Copyright © Peter Hayes 2001-2008 |
You can pass a location to this web page by adding a query string to the URL. It should look something like these examples
| Cheltenham | ?Place='Cheltenham'&Lat=51.88&Long=-2.12&TZ=+1&TZname='BST' |
| Berlin | ?Place='Berlin'&Lat=+52.53&Long=13.42&TZ=+1&TZname='CET' |
| Stockholm | ?Place='Stockholm'&Lat=59.332&Long=18.062&TZ=+1&TZname='CET' |
| Washington DC | ?Place='Washington%20DC'&Lat=+38.88&Long=-77.0&TZ=-5&TZname='EST' |
The Universal Time date and time above depends on your computer having the correct date, time and timezone set.
The sun rise and set calculations are based on the method in the sci.astro newsgroup FAQ by Paul Schlyter. They should be within a few minutes of the correct time except at high latitudes.
The moon rise, set and phase calculations use the methods in Astronomical Algorithms by Meeus. A phase of 360° is a full moon, it reduces to 180° at new moon and 0° at the next full moon. The table for the phases uses the larger of Meeus's corrections and appears to be accurate to within a minute of the tables of moon phases at The US Naval Observatory. There appears to be a slight systematic bias towards these times being a fraction later than the USNO; I assume this is due to using only the larger correction terms and not correcting for dynamic time.
If you want to add sun or moon details to your pages for non-commercial use you may copy the JavaScript and any of these web pages. You must keep my copyright notice in the source. I accept no liability for any errors if you use the code. Please contact me for commercial use, to report problems and to suggest improvements, my e-mail address is on my home page.
If you use Internet Explorer you can use the
File->Save As option and select the type
Web Page, complete to save this page and all
its other files. But Internet Explorer does not save the text 'as is'
but makes un-necessary changes. I recomment you right click on the
following links and select the Save Target As option.
I keep the JavaScript and style sheet in a directory called
library. If you save it somewhere else you will need to
correct the web pages.
| clock.js | contains some time & date utilities. |
| degrees.js | contains additional maths library routines. |
| astro.js | contains general astronomical functions. |
| sun.js | contains the Sun calculations. |
| moon.js | contains the moon calculations. |
| sun_moon.html | contains the source of the sample pages. |
| default.css | contains the style sheet for the web pages. |
I also have some ephemeris pages which calculate an ephemeris for the sun, moon or planets.
To contact me look at the contact me section in my home page.