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, see Reading the Dial in Old Court.

On the Virtual Dial, annotation (labelling of lines) is at present rudimentary, and there are few decorations. In the web browsers Edge, Firefox, Chrome or Opera (but not Safari or Internet Explorer), 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 up-arrow and down-arrow keys to change the number quite quickly, and the dial will respond instantly. If you enter numbers from the keyboard, the dial will not respond until the TAB key is pressed, or you click outside the box. The units of size for “Canvas max” and line-widths are Device Independent Pixels, which might be larger than native display hardware pixels by the current pixel scaling factor.

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 Nodus Shadow cast by the sun is represented by a small yellow-in-black circle, found on the long Style Shadow line (default colour dark orange) representing the shadow of the gnomon or style edge. Information is read from the dial by interpreting the Nodus Shadow 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 Equal 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 mauve) 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 Equal Hour line (see below), and so can be readily identified. The Altitude lines (default colour dark 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 (0°) to the Zenith (90°).

The position of the sun in the sky can be specified in the Equatorial Coordinate System as local Solar Hour-Angle and Declination. An Equal Hour divides the length of a day into 24 equal parts, normally counted from midday (12-hour system) or midnight (24-hour system). The Equal Hour lines (default colour black) are straight, and radiate from the point where the gnomon or style edge intersects the dial plane, except if the dial plane is aligned parallel to the axis of rotation of the earth, when the Equal Hour lines are parallel. The Equal 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 or north, the Equal Hour line for midday (the Meridian) 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.

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.

Both with Equal Hours since sunrise and with Equal Hours since sunset, there is a problem of definition at latitudes more extreme than the polar circles, as there are periods of the year when the sun neither rises nor sets.

The Seasonal Unequal Hours, otherwise known as Temporary, or Temporal Hours (default colour blue-green), 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. Seasonal Unequal Hour lines 0, 6, and 12 are always straight, but other Seasonal Unequal Hour lines are straight only for dials located at the equator: they become steadily more sigmoid as the location of the dial approaches the poles. At latitudes more extreme than the polar circles, the Seasonal Unequal Hour lines converge on the point of intersection of the Horizon line with the Meridian (mid-day) line.

Ecliptic Unequal Hours are another, different, system of Unequal Hours. Just as one Equal Hour can be defined as the time taken for the ascension from the horizon of 15° of the celestial equator line, so an Ecliptic Unequal Hour is defined as the time taken for the ascension from the 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 Ecliptic Unequal Hours are irregular in length, differing considerably both within one day, and from one day to the next. There are 12 Ecliptic Unequal Hours between sunrise and sunset, but they are all of different lengths (unlike the Seasonal Unequal Hours). On the Virtual Dial, the Ecliptic Unequal Hours can be counted from sunrise (on the left-hand half of the Horizon line) using one set of lines (default colour blue) between the December Solstice and the June Solstice, and the other set of lines (default colour red) between the June Solstice and the December Solstice. At the midsummer and midwinter solstices, Ecliptic Unequal Hour 6 is at midday, which, in some cases, might be easier to count from. For dials located at latitudes closer to the equator than the Tropics of Cancer or Capricorn, the lines of Ecliptic Unequal Hours have a figure-of-eight structure.

The term Planetary Hours can refer either (a) to the Seasonal Unequal Hours, or (b) to the Ecliptic Unequal Hours, according to different historical sources. Both unequal hour systems have astronomical definitions, as described above, but the term Planetary Hour has become overlaid with astrological significance, which we need not discuss here.

With both systems of Unequal Hours, there is a problem of definition at latitudes more extreme than the polar circles, as there are periods of the year when the sun neither rises nor sets.

The Ecliptic line (default colour black) is the projection of the great circle which describes the sun’s apparent path among the fixed stars during the course of one year. It is not something which can be displayed by a physical sundial, but it is possible to project a virtual 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 tangential to both the midsummer and the midwinter declination lines, at opposing longitudes, so that only one of those tangent points can appear on a planar dial. The ecliptic line is displayed with with two sets of markers: (a) simple ticks at 15° intervals from the First Point of Aries; and (b) V-shaped ticks at 15° intervals from the Nodus Shadow point. If Annotations are enabled, then alternate ticks in the former set are replaced by the symbols of the zodiac at those points of the ecliptic.

Analemmas look like figures of eight displayed instead of the Equal Hour Lines. They compensate each Equal Hour Line for the Equation of Time appropriate for the time of year. The value of the Equation of Time is the difference between (a) the mean time shown by clocks and watches, and (b) the apparent time shown by sundials. The Analemmas are displayed in two colours: one (default colour blue) to be applied between the December Solstice and the June Solstice, the other (default colour red) to be applied between the June Solstice and the December Solstice. 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 are 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, leading to a sidereal day approximately 4 minutes shorter than a solar day, and a sidereal hour approximately 10 seconds shorter than a solar hour. 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. At the March Equinox, Local Sidereal Time is roughly aligned with Local Solar Time counting hours from midday: thus local solar midday is 0h Local Sidereal Time. At the June Solstice, local solar midday is 6h Local Sidereal Time. At the September Equinox, local solar midday is 12h Local Sidereal Time. At the December Solstice, local solar midday is 18h Local Sidereal Time. 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 the December Solstice and the June Solstice, and the other set (default colour brown) to be used between the June Solstice and the December Solstice. Between the December Solstice and the June Solstice, the (default) olive green line that passes through the intersection of the equator (declination 0°) line and the midday hour line represents Local Sidereal Time 0h. Between the June Solstice and the December Solstice, the (default) brown line that passes through the intersection of the equator (declination 0°) line and the midday hour line represents Local Sidereal Time 12h. Other sidereal hour lines can be counted from one of those two. The Local Sidereal Time can be converted to Greenwich Sidereal Time by knowledge of the local longitude, just as local solar time can be converted to Greenwich solar time.

Marker points on the Virtual Dial:

The following three points are fixed properties of the location and orientation of the 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 celestial North Pole or South Pole are, if displayable, marked in black. The Equal Hour lines converge to one of these points. For a correctly designed physical sundial, this point is the position of the intersection of the line (or edge) of the style and the plane of the dial.

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

The positions of the following two points are re-computed every second by the Virtual Dial:

The Nodus Shadow is marked in yellow with black border. It appears at the intersection of the Style Shadow line with the Ecliptic line, and is displayed even if those lines are not. The Nodus Shadow point is the key to reading information from all the other systems of lines on the dial.

The First Point of Aries is marked in green on the equinox line. The Ecliptic line passes through this point. The Nodus Shadow 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 local 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 of 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. The Virtual Dial 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 by diallists 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

2022 Oct 26: Further improvements to display quality when pixel scaling is in effect. Alignment of marker points with lines improved when pixel scaling is in effect.

2022 Oct 25: Improvements to display quality at non-integral values of pixel scaling ratio. Marker points also scale with pixel scaling.

2022 Oct 23: Tweaks to calculation text block to keep it constrained within the dial canvas on very small screens with high pixel ratio. Restore compatibility with Internet Explorer, broken in 221022.

2022 Oct 22: Dial display made aware of HiDPI displays, Retina displays, and browser scaling, so that display quality is greatly improved on various platforms, particularly smart phones.

2022 Sep 5: Consecutive straight-line segments consolidated into a single straight line: improves anti-aliasing of straight lines marginally. Correction of undefined hour-number zero in the chapter ring.

2022 Sep 3: Positions of lines tweaked so that they better align with markers drawn as rectangular fills.

2021 Dec 8: Marker points are no longer anti-aliased, to make them more well-defined. References to “midwinter” and “midsummer” have been replaced by “December Solstice” and “June Solstice”, so that they apply equally well in either hemisphere.

2021 Dec 1: Tweak for Dark Mode to retain line colours which were background in old scheme as background in new scheme (just as foreground colours were previously).

2021 Nov 27: Revised annotations for the optional Ecliptic line. The position of the sun when below the horizon is now indicated with a faded-out symbol. Tweak for Safari.

2021 Nov 22: Tweaks for Dark Mode on old browsers (IE11).

2021 Nov 20: Fixes to Auto Dark Mode when first launched.

2021 Nov 17: Colour themes: Light mode, Dark mode. The default setting “Auto” follows the theme of the browser or system.

2021 Nov 11: Made the user interface more accessible. Provided tool-tips for sighted users, and equivalents for visually-impaired users with screen-readers.

2021 Nov 8: Re-ordered the feature selection options. Made the zodiac symbols slightly smaller. Minor correction to suppress Ecliptic Unequal Hours in polar regions at times of year when sun neither rises nor sets.

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.