The Virtual Dial

Click here to see the Virtual Sundial or read on for more information.

This page links to an animated simulation of a sundial. The initial dial geometry is that of the sundial at Queens’ College, Cambridge, UK, but you can change the settings to any plane geometry at any location in the world. For hints on reading the real Queens’ sundial, which also apply to reading this Virtual Dial, click here.

On the Virtual Dial, annotation (labelling of lines) is at present rudimentary, and there are no decorations. In the web browsers Firefox, Chrome or Opera (but not Internet Explorer, Edge, or Safari), it is possible to save the dial design as a PNG graphic file by right-clicking on the dial canvas. For selecting colours, some web browsers offer a Colour Picker pop-up, others just present a code in the form #rrggbb where rr, gg, bb are hexadecimal values in the range 00 to ff for the colours red, green, blue. You may edit that string to change colours. For entering numbers, some web browsers offer spin-boxes to increase or decrease the number, others present the number for manual editing only. In the case of browsers offering spin-boxes, you can click in the box to put the mouse cursor there, then use the scroll-wheel to change the number quite quickly over large increments.

Information displayed on the Virtual Dial

You can choose whether to view the Virtual Dial with the time shown by a Mean Sun (displaying civil mean time from your computer’s clock), or with the time shown by an Apparent Sun, emulating real sundials: in which case, the time indicated needs to be corrected by the Equation of Time.

The shadow of the nodus cast by the sun is represented by a small yellow circle, found on the long line (default colour dark orange) representing the shadow of the style edge. Information is read from the dial by interpreting the shadow of the nodus among the various systems of lines drawn on the dial plane. The time of day can be read simply by looking at the style shadow line among the Hour lines discussed below.

The position of the sun in the sky can be specified in the Local Horizontal Coordinate system as Azimuth and Altitude. The Azimuth lines (default colour mid-blue) are straight. On a vertical dial, the Azimuth lines are parallel and vertical, otherwise, they converge either to the Zenith or to the Nadir. The Azimuth lines shown are spaced at intervals of 11¼° measured along the Horizon, corresponding to the points of a 32-point compass. The Azimuth line for the meridian is the same as the midday Hour line (see below), and so can be readily identified. The Altitude lines (default colour red) are curved hyperbolae, or ellipses (for non-vertical dials), except for the Horizon, which is straight and horizontal. In the case of a horizontal dial, the Altitude lines are circular, and the Horizon is not visible. The Altitude lines shown are spaced at intervals of 10° from the Horizon.

The position of the sun in the sky can be specified in the Equatorial Coordinate System as Hour and Declination. The Hour lines (default colour black) are straight, and radiate from the point where the style intersects the dial plane, except if the dial plane is aligned parallel to the axis of rotation of the earth, when the Hour lines are parallel. The Hour lines shown are separated by 15° intervals measured along the celestial equator, corresponding to one hour of time. On a dial which is either (a) vertical, or (b) reclining but facing south, the Hour line for midday is the only vertical hour line, and so can be readily identified: the others can be counted from midday. The Declination lines (default colour green) are curved hyperbolae or ellipses, except for the equator line (declination 0°) which is straight. The other declination lines shown mark the boundaries of the twelve zodiac periods. The shadow of the nodus passes (a) along the straight 0° declination line at the March and September Equinoxes, (b) along the highest declination line at the Winter Solstice, and (c) along the lowest declination line at the Summer Solstice. Between a solstice and an equinox lie three zodiac periods. The shadow of the nodus amongst the declination lines can be used to estimate the time of year, there being two possible dates associated with each declination value: one date between midsummer and midwinter, and the other between midwinter and midsummer.

The Unequal Hours (otherwise known as Temporary, Temporal, or Seasonal Hours) divide daylight (between sunrise and sunset) into twelve equal parts, which change in length according to season: short in winter, long in summer. The hours are numbered from sunrise (zero) to sunset (twelve). This was once a common method of measuring working hours, and is the context within which the expression at the eleventh hour is to be understood. These Unequal Hour lines are straight only at the equator: they become steadily more sigmoid as the poles are approached, and beyond the arctic circles, there is a problem defining what they mean, as there can be days when the sun never rises or sets.

Equal Hours since sunrise, otherwise known as Babylonian Hours, (default colour purple) was a system of time-keeping using equal hours but counting from a start of day at sunrise (rather than midnight).

Equal Hours since sunset, otherwise known as Italian Hours, (default colour orange) was a system of time-keeping using equal hours but counting from a start of day at sunset.

Analemmas look like figures of eight displayed instead of the Hour Lines. They compensate each Hour Line for the Equation of Time appropriate for the time of year. The value of the Equation of Time is the difference between the mean time shown by clocks and watches and the apparent time shown by sundials. The Analemmas are displayed in two colours: one (default colour blue) to be applied between midwinter and midsummer, the other (default colour red) to be applied between midsummer and midwinter. If you choose to view the Virtual Dial with Analemmas shown, then you should also select to view the Apparent Sun rather than the Mean Sun: then the Virtual Dial will behave like a true sundial, and show apparent solar time rather than Mean Time.

Sidereal Hours is a system of time-keeping based on the fixed stars. A Sidereal Day is defined as the period for one rotation of the earth relative to the fixed stars, rather than the sun. A sidereal day is shorter than a solar day, such that there is precisely one more sidereal day per year than there are solar days per year. Local Sidereal Time each sidereal day is reckoned from the moment that the First Point of Aries (the location where the ecliptic line cuts the earth’s equatorial plane at the March Equinox) passes over the local meridian. The sidereal hour lines appear on the Virtual Dial as a pattern of two intersecting diagonal lines, with one set (default colour olive green) to be used between midwinter and midsummer, and the other set (default colour brown) to be used between midsummer and midwinter. The sidereal hour line which represents the moment that the First Point of Aries passes over the meridian is the line which also passes through the conventional solar midday point on the straight equator line, and other sidereal hour lines can be numbered from that line.

Ecliptic Planetary Hours are another system of Unequal Hours, not the same as the Temporary, Temporal, or Seasonal Unequal Hours discussed above. Just as one Equal Hour can be defined as the time taken for the ascension of 15° of the celestial equator line, so an Ecliptic Planetary Hour is defined as the time taken for the ascension (from the eastern horizon) of 15° of the ecliptic line, counting from zero at sunrise. Because the ecliptic line itself shifts in azimuth and tilt from one moment to the next, the Planetary Hours are irregular in length, differing considerably both within one day, and from one day to the next. There are 12 Ecliptic Planetary Hours between sunrise and sunset, but they are all of different lengths (unlike the Seasonal Unequal Hours). The system of Ecliptic Planetary Hours, originally defined astronomically, has become overlaid with astrological significance, which we need not discuss here. On the Virtual Dial, the Ecliptic Planetary Hours can be counted from sunrise (on the left-hand half of the Horizon line) using one set of lines (default colour blue) between midwinter and midsummer, and the other set of lines (default colour red) between midsummer and midwinter.

The Ecliptic line (default colour black) is the great circle in the sky which describes the sun’s apparent path during the course of one year. It is not something which can be displayed by a real sundial, but it is possible to project the ecliptic line onto the plane of the Virtual Dial, where it appears as a straight line. The ecliptic line passes through the position of the sun, and the position of the First Point of Aries. The ecliptic line is displayed with markers at every 15° of longitude from the current position of the sun.

Marker points on the Virtual Dial:

The sub-nodus point is marked in red, and by default appears at the centre of the canvas. For a vertical dial, it appears on the Horizon line.

The earth’s North Pole or South Pole is marked in black. The Hour lines converge to one of these points. For a correctly designed sundial, this point is also the position of the intersection of the line of the style and the plane of the dial.

The Zenith and the Nadir are, if displayable, marked in blue. For all except vertical dials, the Azimuth lines converge to one of these points.

The First Point of Aries is marked in green on the equinox line (it is probably visible only within a couple of months of the March Equinox). The Ecliptic line passes through this point. The shadow of the nodus passes through this point at the moment of the March Equinox.

Straight lines on sundials:

A Great Circle in the heavens will project onto the plane of any sundial as a straight line. For instance:

  • The straight Hour lines on a sundial are projections of Great Circles which pass through the North Pole and South Pole points in the sky;
  • The straight Azimuth lines on a sundial are projections of Great Circles which pass through the Zenith and Nadir points;
  • The straight Equinox line on a sundial is a projection of the Great Circle of the Celestial Equator;
  • The straight Horizon line on a sundial is a projection of the Great Circle of the local Horizon;
  • The straight Ecliptic line on the Virtual Dial is a projection of the Great Circle known as the Ecliptic, the annual path of the sun through the fixed stars.


This program simulates sundials with a flat plate. The flat plate of a sundial is an example of what is known mathematically as a plane. The orientation of a plane in space is specified completely by the direction of its normal, a line perpendicular to the plane. Two parameters are sufficient to uniquely specify the direction of a line in space, and hence the orientation of a plane. This program requires a specification of sundial plate orientation which is equally valid in the northern or southern hemispheres.

The chosen method is to specify the direction of the normal in the local horizon coordinate system used by astronomers. The local horizon coordinate system is a type of spherical coordinate system in which a direction is specified by two parameters: the Azimuth (measured in degrees along the horizon from a specified origin), and Altitude (measured in degrees up at right-angles from the horizon). These terms might not normally be used by diallists. The correspondence to diallists’ terminology is as follows:

Azimuth: In the northern hemisphere, a dial described as South declining 15 degrees West has a normal with Azimuth of 15 degrees west of South. A dial described as South declining 9 degrees East has a normal with Azimuth of -9 degrees west of South.

The Altitude of the normal corresponds directly to what diallists know as Reclination, varying from 0 for a vertical dial (as at Queens’), to 90 degrees for a horizontal dial.

Future plans:

  • Annotations (part done) and Decorations.


How to read the sundial in Queens’ College.
History of the sundial in Queens’ College.

Further reading

2013: Planetary Hours, by Michael Lowne and John Davis, in Bulletin of the British Sundial Society, 25(iii), September 2013, pp. 40–​48. (ISSN 0958-4315)

Revision history

2017 May 30: Reworked display of both the “Apparent Sun” and the “Mean Sun” (showing civil time) so that (a) the Apparent Sun shows at its correct Declination, and (b) the Mean Sun lies on the Ecliptic line of the Apparent Sun (and thus in general at a slightly different Declination). At the equinoxes, the Apparent Sun will track the zero declination line, but the Mean Sun will not quite do so.

2017 May 29: Fixed bug causing First Point in Aries marker incorrectly to move when “Apparent sun” selected.

2017 May 19: UI re-arranged for windows wide enough; ecliptic planetary hour display extended into night time.

2017 May 14: UI selections for colour and width of Style Shadow line, which can also be turned off.

2017 May 8: revised method for display of altitude curves.

2017 April 30: Sense of up/down nodus shift reversed so that shift matches arrows on spin-boxes. Some bugs fixed in display of altitude curves.

2017 April 20: Zodiac annotations improved, azimuth annotations added.

2017 April 18: Preliminary annotations for hour lines and declination lines (can be turned off). Calculation panel moved to centre, and can be switched off.

2017 April 14: Analemmas added (optional), with an option to cause the shadow of the nodus to follow the Apparent Sun (as with a real sundial) rather than the Mean Sun (as with clocks and watches). The Equation of Time value added to the display of calculations. User interface updated into tabular form.

2017 April 11: Planetary Hours added (optional). The optional Ecliptic line also shows markers at multiples of 15° of celestial longitude from the sun.

2017 April 9: Ecliptic line added (optional). Text display of sun’s positional coordinates in real time and dial geometry restored.

2017 April 8:  Sidereal Hour lines added (optional), and an indicator of the First Point of Aries on the equinox line. Data entry fields converted to support spin-boxes in some browsers (not Internet Explorer, not Edge). Improvements in clipping certain lines as they cross the Horizon.

2017 April 3: line colour and widths user-selectable. Fading of line colours outside area where nodus shadow can appear. Equal Hours since sunrise and since sunset added (optional).

2017 March 27: first implementation of translation from original Java applet into JavaScript and HTML5 canvas. Scalable canvas to fit client size, for instance, on mobile devices with small screens.

2002 Apr 3: corrected bug causing sun's shadow to be misplaced if a nodus shift was in effect.

2000 Apr 30: Clipping of altitude lines implemented more properly.

2000 Apr 17: Changed temporal hour line colour from magenta to cyan to reduce confusion with altitude lines. Bug fixes for clipping of azimuth lines. Another Java-AWT drawing problem worked around.

2000 Apr 12: Added the ability to display British Summer Time in the local time (this daylight saving zone is not normally available in Java 1.1.x). Most USA daylight savings zones should already work. If the browser supports Java 1.1.6 or higher, then various other regional daylight savings schemes should also display correctly. Otherwise, the local time zone will be displayed as an offset from GMT.

2000 Apr 3: Added ability to shift nodus horizontally and vertically.

2000 Mar 30: Temporal hour lines added, coloured magenta. A temporal hour is a type of unequal hour in which the period between sunrise and sunset is divided into 12 equal parts, which vary in length according to the season of the year, equalling mean hours only at the equinoxes.

2000 Mar 28: Internal clipping implemented to work around AWT masking all integer coordinates to 16 bits before using them.

2000 Mar 27: Minor drawing bug fixes.

2000 Mar 26: A start has been made on clipping the colouring of the constant-azimuth lines to the area contained within the solstice lines, leaving a faint line outside in circumstances deemed interesting. Some terminology revised.

2000 Mar 20: The Vernal Equinox: first trial public release.