Basic Trigonometry

The formula for calculating the hourlines on a horizontal sundial is:

tan X = (tan h)(sin lat)

Where:

X = the result, the angle the hour line makes with the 12 o'clock line.

h = the time (hour angle) measured from noon in degrees. The earth rotates 360 degrees in 24 hours, or 15 degrees in 1 hour

lat = the latitude of the dial.

Here is the framework for a BASIC program for computing the angles for the hourlines from 6 AM to 6 PM on a horizontal dial located at 35º . The program will not work as-is because most BASICs require angles to be computed in radians.

Use the format to build your own programs; or for a calculator or spreadsheet.


1 CLS
2 lat = 35
3 FOR h = -90 to 90 STEP 15
4 X = ATN((TAN(h)*SIN(lat))
5 PRINT X
6 NEXT
7 END

You can apply the longitude correction (time zone offset) by changing line 3. For instance, if your longitude is 4.56 degrees east of your central meridian, you would add 4.56 to the value for h, and line 3 would be:

3 FOR h = -90 + 4.56 to 90 + 4.56 STEP 15

But let's do the arithmetic, and while we're at it, let's change the STEP value to produce half-hours.

3 FOR h = -85.44 to 94.56 STEP 7.5