Home | Science | Solar Computer |     Share This Page

 Sun Calculator Help

P. LutusMessage Page --

© Copyright 1996, P. Lutus

Be sure to visit the www.arachnoid.com Main Page

  Computing the Sun's Motion

Figure 1

From the perspective of an observer on the Earth, the sun makes some obvious, and also some subtle, motions across the sky.

The first and most obvious is the daily rotation around the sky, east to west, with a duration of 24 hours. The second is a seasonal north-south motion of ± 23° 27' away from the equator.

The third motion is a subtle change in the sun's noontime position, brought on mostly by the earth's axial tilt, but with a small additional component produced by the earth's non-circular (elliptical) orbit around the sun. Because of these seasonal motions, if a camera were to be set up and the shutter opened for a moment each noontime, over a year the film would record the image in Figure 1.

A program that keeps track of the sun (called a solar ephemeris) must accurately represent all these motions. If it is to calculate sunrise and sunset times, it must also accept earthly position entries as well.

Sun Calculator first calculates the sun's position very accurately, then it applies this information to the problem of computing sunrise and sunset times.

  Sunrise, Sunset Issues

Apart from the problem of calculating the sun's position in space relative to the earth, one must also calculate the relative motion of the sun at each point on the earth's surface. From the relatively trivial example of a tropical location, with regular sunrise and sunset times year-round, one must also take into account the extreme cases of positions near the north and south poles, where for much of the year the sun is either completely above or below the horizon.

Sun Calculator must also take into account the fact that the earth's atmosphere acts as a big lens, bending the sun's rays substantially when the sun is near the horizon. This effect changes with air pressure and temperature, but on average the sun appears lower in the sky by 35 minutes of arc than it would without the atmosphere's effect.


The moment of sunrise/sunset is defined as the time at which the sun's upper limb is resting on the horizon. From earth, the sun's apparent diameter is 30 minutes of arc, so one must subtract a solar radius of 15 minutes of arc, plus 35 minutes for atmospheric refraction, to predict when the sun's upper limb will appear to be grazing the horizon. In the real world, of course, the sunset time prediction is not usually borne out — because the atmosphere is disturbed, because one is almost never standing on a flat plain with no hills on the horizon, and other things. This is the difference between mathematics and experience.


There are four generally accepted definitions of twilight with four light levels and four purposes:
Twilight Name Sun's Distance Below Horizon Definition
Sunset 0° 50' Because of atmospheric refraction, the sun's upper limb appears to be touching the horizon.
Civil The time after which city streetlights are lit, automobiles begin using headlights, in general, the time after which we use artificial light.
Nautical 12° The best time for a sailor to use a sextant to take a star sight — the horizon is still visible, and many navigational stars are also visible. Earlier, some important navigational stars will not be visible. Later, the horizon becomes too difficult to see through the sextant.
Astronomical 18° After this time, the sky is dark enough for astronomers to make productive use of powerful telescopes. Only the faintest glow is visible near the sun's position.

In the United States, it is generally accepted that civil twilight ends 30 minutes after sunset. This is obviously an average value for use by people in a society without computers, because in reality there are substantial variations — in Honolulu, Hawaii, civil twilight lasts 22 minutes. In Seattle, Washington it lasts 30 minutes, and in Fairbanks, Alaska (on an average day) it lasts 50 minutes. In mid-summer, Fairbanks' civil twilight never ends — it lasts all night (all two hours of it).

Above the Arctic Circle (66° 33' North), there are days when the sun never sets or never rises. These dates and locations are handled by Sun Calculator with the special labels "[Above]" and "[Below]" instead of times, to indicate that the sun's light (or a particular twilight) continues indefinitely on that date.

Now stretch your mind — imagine being at the north pole. On June 21st, the sun is about 23° above the horizon and travels around in a circle, always visible (weather permitting). On September 21st or thereabouts, the sun sits on the horizon all day, slowly moving in a circle. During the next few days it gradually "sets," not to be seen again for six months.

  Choosing a Location with the Maps

If you want to select a location in the US "lower 48," you may simply click the map of the contiguous United States to enter a position. When you click the map, the geographical position is made available to the main computing routine and the sun's behavior for that place and date is computed. Use this same method for other world locations by using the world map.

  Choosing a Location with the Drop-down Lists

Sun Calculator has five drop-down lists of locations to choose from. Larger cities in the US and elsewhere in the world are available, as well as a list of airports organized by their 3-letter codes. Simply open a list and select a location — double-click the mouse to calculate one. When you have done so, the name of the location will be transferred to the "Place Name" windows and the geographical position will be used for the computation.

  Entering a Position Manually

If you wish to enter a geographical position directly, just use the Time/Date/Position dialog and enter the degrees and minutes of latitude and longitude and the hemisphere (North South, East, West) using the provided radio buttons.

  Selecting a Time Zone

Sun Calculator uses a simple method to guess the time zone of a particular location. Since people rather randomly decide which time zone they are in, Sun Calculator's guess is frequently wrong. Unfortunately, it would be quite impossible to include enough information to predict all the time zone choices people have made worldwide. If you need to change the time zone, simply select a position first, then use the Time Zone drop-down list (located on the time/date/position panel) to manually correct the time zone. Simply double-click the desired time zone and the computed figures will be changed to reflect your choice.

  Daylight Saving Time

Sun Calculator calculates the actual definition of Daylight time (at least for the US) — daylight time begins on the first Sunday in April and ends on the last Sunday in October. In the event that you need to manually change the daylight time setting, first select a date, then toggle the daylight time setting.

These Pages Created and Maintained using   Arachnophilia.

Home | Science | Solar Computer |     Share This Page