back to home page

Flat Sundial Computations

Slawomir K. Grzechnik


Why sundials? The best answer is: for fun. They give us joy of understanding a tiny bit of a tiny part of the Universe using means available at every backyard. They remind us about passing of time. While looking at a sundial we are in fact touching the Universe in a very personal way. Sundials also establish our link with the past generations who invented them, cherished them and used for thousands of years. Today the Coordinated Universal Time is ticked by atomic clocks of superb accuracy, much more accurate than "devices" like the Earth and the Sun. And yet twice a year the scale of atomic clocks is adjusted so that it never differs more than one second from the Greenwhich Mean Time governed by the Sun. The article shows the method of calculating flat sundials which may be implemented on computers.


Contents


General Info

A sundial consists of a style casting shadow on some kind of a dial. The Celestial Sphere performs daily rotations about the Earth’s axis. The Sun’s apparent movement on the sky is the superposition of the rotation of the Sphere and Sun’s proper motion with respect to it. Most sundials have styles oriented parallel to the Earth’s axis so hourly shadows have approximately the same direction on the dial independently of seasons. To place the style correctly we need to position it in the plane of the local meridian and tilt it by the angle of the latitude of the place so that it points towards the Celestial Pole. At night we would see it pointing towards Polaris on the Northern hemisphere.

For the needs of backyard sundialing we may use good magnetic compass to determine the direction of the North. We have to remember however to allow for magnetic variation being the difference between true and magnetic North. This variation changes from place to place and may be significant, e.g. in California it is about 14° E, i.e. 14° have to be added to all compass reading to convert them to true directions. In first approximation we may read the latitude from some large scale map, use astronomical navigation methods if we know how and have relatively expensive instruments like sextant or use GPS. Practical methods of determining North are given in the article devoted to the subject.

Having positioned the style we should decide what kind of dial we are going to use. The easiest to construct are plane or flat dials and calculations for them follow. The orientation and tilt of the dial are arbitrary so long as style shadow casts onto the dial. Horizontal dial naturally has a single orientation but vertical and/or tilted dials may have arbitrary orientation enhancing the esthetic effect.

This article describes how to calculate planar or flat sundials with style parallel to Earth's axis and the dial with any orientation and tilt. However the method described here is general and may be applied to any surface of the dial.


Frames of Reference

In computations we use three frames of reference or coordinate systems, two of them are spherical and one Cartesian:

  • Astronomical equatorial coordinates
    May be thought of as a projection of geographical coordinates onto the Celestial Sphere. Declination (corresponding to geographical latitude) is the angle between the Celestial Equator and the direction to celestial object, it is measure North and South. Local Hour Angle (LHA) is the angle between celestial object’s meridian and the observer’s local meridian. LHA grows due to the rotation of the Celestial Sphere. Coordinates of celestial objects expressed in this system are independent of observer’s location. In case of “fixed” objects like distant stars their declinations may be assumed constant and only their LHAs are growing uniformly.

  • Astronomical horizontal coordinates
    Altitude is the angle between local horizon and the celestial object. Azimuth is the angle between true North and the object. Obviously these coordinates depend on observer’s location.
     
  • Cartesian coordinates of the dial face

The natural frames of reference for daily positions of the Sun at any hour are easiest to express using equatorial astronomical coordinates. Using ancient astronomical formulae we may convert to slightly modified horizontal coordinates. Having horizontal coordinates we calculate the direction of the Sun ray in dial's Cartesian coordinates enabling us to trace the path of the style's shadow on the dial's face.

The calculations are relatively easy and fast when using a computer or advanced calculator. Using the Descriptive Geometry takes much longer and requires certain knowledge but certainly it is worth doing it once.

At the beginning let us introduce the Cartesian frames corresponding to spherical horizontal coordinates:

  • axis x1 - directed to the South on Northern hemisphere, to the North on Southern hemisphere
  • axis x2 - directed to the East on Northen hemisphere, to the West on Southern
  • axis x3 - pointing to the Zenith (right above our heads)

Thus we have right-handed frames attached to the location of the dial with the main axis oriented N-S.

Next we introduce Cartesian frames (primed) attached to the dial plane

  • axis x1' - normal to the dial plane (towards the observer)
  • axis x2' - horizontal, directed to the right from observer's point of view
  • axis x3' - in the dial plane, directed so that the frames are Cartesian and right handed

The axes x2', x3' and planes determined by them may be the basis for the draft for the construction of the dial. The relations between frames are shown on figure 1

The easiest way to place the style properly in our model is to use our non-primed frames. The style lies in x1x3 plane and forms with the horizontal plane x1x2 an angle equal to the latitude of the place. Let us denote transformations between frames in "classic" way using Einstein’s summation convention

xi = Aii'xi',     i, i' = 1, 2, 3

xi' = Ai'ixi,      i, i' = 1, 2, 3                        

where xi, xi' are vector coordinates in non-primed and primed frames respectively. Occurrence of an index twice as subscript and superscript means summation over the whole range of an index (in this case 3). Transformation coefficients Aii' may be written down as a matrix . Then the superscripts denote rows and subscripts denote columns. Using this kind of matrix notation we assume that vectors are columns. The easiest way to obtain coefficients Aii' is to express primed frames versors (vectors of unit length) in non-primed frames coordinates and put them as columns of the matrix [Aii']. The matrix [Ai'i] is the inverse of [Aii'] . Generally if both frames are Cartesian and basis vectors are of unit length then the matrix of inverse transformation is simply the transpose of the transformation matrix which means we do not have to invert matrices.


Calculations

We will show a cycle of calculations for one time of day to determine the shadow line of the style for given time on the dial. We repeat them for as many times as needed. Most sundials show shadow lines for 30 minutes intervals. For calculations we assume some declination of the Sun. The directions of shadow lines do not depend on declinations due to orientation of the style along the Earth’s axis. Declination determines the length of the shadow and it may be used to determine season of the year (if all other means fail J). Many sundials include paths of shadow end points at equinoxes and summer and winter solstices and greatly add to the dials look.

So let us start calculations. For given time of the day the Sun has some declination dec and Local Hour Angle LHA. We usually perform calculation for the following declinations:

  • 0° - for spring and autumn equinox
  • 22° 27' N - summer solstice
  • 22° 27' S - winter solstice

LHA of the body may be expressed in 0-360° system and then it is always measured westwards that is in the direction of the revolution of the celestial sphere, or in 0-180° system West or East from the local meridian. The West LHA grows with time at the rate of the revolution of the celestial sphere (15°/h) and the East LHA decreases at the same rate which should not be a surprise. For our purposes we may assume that the Sun during one day is attached to the celestial sphere (which strictly speaking is not true because of Sun’s proper motion). Then the Sun's LHA changes 15° /h. At true local noon the Sun will be exactly on the local meridian (this is the definition of noon by the way) and the LHA would be 0°. At 1 PM (1300) the LHA will be 015° , at 2 PM (1400) 030° (030° W) and so on. At 6 AM (0600) the LHA will be 270° (090° E), at 7 AM (0700) it will be 285° (075° E) and so on.

Having dec and LHA of the Sun we want to calculate the corresponding Sun's altitude and azimuth. To do that we use ages old formulae used by astronomers and navigators and navigators for centuries:

sin( h ) = sin( lat )sin( dec ) + cos( lat )cos( dec )cos( LHA )              (*)

ctg( A ) = cos( lat )tg( dec ) / sin( LHA ) - sin( lat )ctg( LHA )           (**)

where

  • h - altitude
  • lat - latitude
  • dec - declination
  • A - azimuth
  • LHA - Local Hour Angle

 

We should use common sense when solving the equations. To start with should attempt to avoid divisions by zero (unless absolutely necessary :-).  If LHA is 0 then azimuth A is 0 is simply 180° so solving (**) would be an overkill. In order to avoid known pitfalls of solving trigonometric equations, such as determination or guessing the quadrant of the found angle I propose again ages old conventions used by navigators who could hardly tolerate errors:

latitude (lat) we assume to be always positive

  • declination (dec) is positive when of the same name as latitude, negative otherwise (recall that both latitude and declination take values from 0° to 90° and  may be N or S (or (+) or (-) respectively); what is the name of 0° declination, N or S, is up to you J)
  • LHA is expressed in 0-180° system and named W or E depending to which half of the celestial sphere the body belongs at given time

Then by solving (*) and (**) we get:

  • altitude h, when positive then the object is above the horizon, negative otherwise
  • azimuth A in 0-180° system (e.g. N 080° W, or S 120° E, et.c.), to establish both names follow the rules:
    • second name is E or W and is the same as of LHA expressed in 0-180° system
    • first name is the same as latitude if the right hand side of (**) is positive and opposite to latitude if the right-hand side of (**) is negative.
    • Having established both names you may express azimuth in some other system, e.g. 0-360°

Let us now find the direction of the Sun ray v, which is the vector of unit length, in the non-primed frames. Having spherical coordinates of the Sun in the horizontal system altitude h and azimuth A (radius is 1) we introduce variable b to use instead of azimuth

b = 180° - A

With angle b finding Cartesian coordinates of the ray v = [v1, v2, v3 ] T  is straightforward (Superscript `T’ stands for transpose, remember we assumed vectors to be columns):

v1 = cos( h ) cos( b )

v2 = cos( h ) sin( b )

v3 = sin( h )

Now we may come back to using azimuth A instead of b by substituting the equation for b = 80° - A and after elementary operations we will get

v1 = -cos( h )cos( A )

v2 = cos( h )sin( A )

v3 = sin( h )

Using transformation equations we express v in primed frames that is the frames of the dial

vi' = Ai'ivi

In primed frames we write the equation of the Sun ray as the parametric equation of the straight line in the direction v of passing through the style end point P1 and parametrized by t:

xi' = vi' * t + xi'P1       i’ = 1,2,3       (i)

where xi'P1 are primed coordinates of the endpoint P1 of the style. Let us write the equation of the dial plane

x1' = 0                                   (ii)

Equations (i) and (ii) together enable to calculate the point at which the line described by (i) pierces the plane described by (ii). There are four unknowns  x1', x2', x3' and the value of parameter t for which the line pierces the plane and there are four equations so we may attempt to solve them. If the solution, that is coordinates of the shadow on the dial face lies in infinity it means that at given time the Sun ray is parallel to the dial face.

To draw the line of shadow we need one more point and this could be the point P3 where the style pierces the dial plane (in fig. 1 P3 would be the same as P2). Note that sometimes point P3 may be at infinity.

This concludes the procedure for a single hour angle of the Sun. We repeat it for every hour line we want to have on the dial.


Times

Comparing sundial readings with the clock showing the Zone Time reveals significant differences between both. There few factors contributing to this difference:

  • Equation of Time.
    The Sun does not move uniformly in its yearly path across the Celestial Sphere. This is due to the fact that Earth’s orbit is elliptical rather than circular and the Sun seems to move faster when the Earth is close to it and slower when it is farther away. The second component is the tilt of the plane of Ecliptic with respect to the plane of the Celestial Equator. This forced astronomers to introduce the abstract Mean Sun being the pint moving uniformly along the Celestial equator in this yearly path. The difference between the Mean and the True Solar Time is called the Equation of Time. See Equation of Time for splendid explanation.

  • Difference in longitude between the sundial location and the central meridian of  the Time Zone used in daily life. The difference in longitude may be expressed in time units using the conversion tables. This may not be enough though if the Zone’s Time is defined in some other way.

  • Changes from Zone’s Standard Time to Zone’s Daylight Saving Time and vice versa

  • Irregularities of the Earth rotations may be neglected

Summing up we may write the relation between Local Solar Time LST and the Standard Time of the place.
 

ST  =  LST + E - DT

LST =   ST - E + DT

where E stands for the Equation of Time

E =  LMT  - LST,        LMT being Local Mean Time

and DT is difference of longitude between Time Zone's central meridian and the sundial location expressed in time units. The equations take into account algebraic signs of corrections


Example

Fig. 2 shows the dial on the vertical wall with its southern normal pointing to azimuth 198°. The latitude of the place is 52°'14’ N. Fig. 1 shows primed and non-primed frames for this dial. Horizontal and vertical straight lines are axes x2', x3' respectively. Short, "fat" segment presents the style. Hourly lines are at 30m intervals. The upper curve is the path of shadow on the winter solstice day, the lower curve – on the summer solstice. The sloped, straight line is the shadow path during equinoxes. Note that the equinox line is normal to the projection of the style onto the dial face (in general it is normal to the local merdian plane in which the style is positioned). Note also, that the noon shadow line is vertical.

Fig. 2.

The drawing was done using simple C++ program doing calculations described in this article.


Conversion of arc to time and vice versa

The tables can be obtained easily that the full rotation of the Celestial Sphere by 360° angle takes 24 h. The division of the full arc into 360 units done by Babylonian astronomers who wanted to use the whole number having many divisors and close to the number of days in a year

  4            1h   15°

1'  4            1m   15'

1''   1/15       1s   15'' 


Literature and Links

Jul 10, 1996