List Members,

On 1/28/2000 Fer deVries wrote:

>...............    In Amersfoort recently a sun pointer is erected. It
>is a mechanical driven and computer controled arrow that
>always points to the sun, during the day and the night, in all
>kind of weather, cloudy or clear.

>A picture of it may be found at 
>http://www.iae.nl/users/ferdv/sunpointer.htm

>In the arrow are 2 digital displays, one for civil time and one
>for local suntime.  In this way people can read the difference
>between "artificial time" and "natural time".

>Are there more "sun pointers" in the world?

>Fer J. de Vries
>[EMAIL PROTECTED]
>http://www.iae.nl/users/ferdv/
>Eindhoven, Netherlands
>lat.  51:30 N      long.  5:30 E

Inspired by Fer's message, I have written a little program in
primitive Basic,  TM-O-DAY.BAS.  I append it below, free for 
non-commercial use by anyone.  Play with it, improve upon 
it, as you see fit.  This < 3300 byte program graphically
depicts the real-time apparent motion of the True Sun, along 
with that of the imaginary Mean Sun.  Both are shown as 
related to the horizon, (rising and setting) the local meridian, 
(local apparent noon and midnight) and to the equinoxes 
(seasons.) 

The display shows the sun's apparent path as a reddish 
("magenta") circle on a blue field.  There is a reddish vertical 
line for the local meridian, and a reddish horizontal line for 
equinoxes.  On this rubric, <g> a small white circle moves 
clock-wise in representation of the Mean Sun of STD as if 
seen looking southward.  Thus it presents a 24 hour clock 
face.  Another small red circle moves on the same circle, 
but at solar rate,  appearing to gain and lose relative to the 
white circle, in accord with the equation of time and local
latitude difference.

(Southern hemisphere dwellers may insert a line
 ahead of the CIRCLE commands as shown here:

Rkx = -Rkx : Rsx = -Rsx 
CIRCLE (320, 280), 170, 13
CIRCLE (Rkx, Rky), 3, 15
CIRCLE (Rsx, Rsy), 3, 12: PAINT (Rsx, Rsy), gs, 12

to have counterclockwise rotation as if looking northward.)

There is a horizon line, that divides the screen and 24 hour 
circle into light blue for daytime above, and dark blue night 
below.  When the True sun is above the horizon, its red circle 
is filled bright yellow, when below (after "geometrical sunset"), 
the night color appears within the red outline ring.  (The STD 
sun is always the same open white ring.)  The height of the
horizon line varies seasonally with declination, to show how
daylight periods vary.

Some time-related data appears above the graphic, includimg
digital Mean and Solar Times to the closest minute. The program
uses mean noon values of  Equation of  Time for a typical year,
(1982) which is correct to whithin about half a minute, or better,
for any year.  (Similar to tables in Waugh or the Mayalls texts.)

The program was written on an MS-QBasic, Version 1.1, editor,
but is pretty generic, and should work in most other Basics. 
Specific local information (Lat., Long., and Time Zone
Meridian) must be provided in program mode by the user, which
avoids the need to ENTER each time the display is run.  The
program uses a PC's, or clone's, system clock, (no provision 
for Daylight Savings.)   One should keep in mind the poor time-
keeping performance of most computers.  The computer must 
support VGA or SVGA graphics, and of course have a Basic
installed..  

The program listing below may be high-lighted to COPY (via
File menu of  e-mail manager) and pasted into a word processor.
Check to make sure the longer lines of the print statements have
not been folded.  Then SAVE AS  (TM-O-DAY.BAS) to the
DOS directory that contains your Basic.

Good luck and have fun,

Bill Maddux
============================================

REM This is TM-O-DAY.BAS
REM W. S. Maddux 2/1/2000
REM Gives True Time and Clock Time through Day and Night.
10 CLR: CLS
 REM Enter lat., long., and time meridian in lines #s 20, 22, & 24
 PI = 3.1415927#: R1 = .0174533
 DIM M$(12), M2(12)
 REM L3 = Latitude (dcml. degs.)
20 L3 = 40.366:
 REM L4 = Longitude (dcml. degs.)
22 L4 = 74.645:
 REM L5% = Standard Time Meridian (degs.)
24 L5% = 75
 REM Time Difference for Longitude
 L6 = L4 - L5%: S6 = SGN(L6): L6 = ABS(L6) * 400
 L6 = INT(L6): L6 = S6 * L6 / 100: L6 = -L6 * 100: L6 = CINT(L6) / 100
 FOR M1 = 1 TO 12
 READ M$: M$(M1) = M$
 READ M2: M2(M1) = M2
 NEXT M1
30 CLS
SCREEN 12: 'VGA or SVGA 640 by 480, 16 colors
LINE (0, 0)-(640, 480), 1, BF: 'Sets background blue

n$ = LEFT$(DATE$, 2)
N1% = VAL(n$)
M$ = MID$(DATE$, 4, 2)
N2% = VAL(M$)
PRINT "     Date is "; DATE$; " :   Long. Diff. (m) ="; L6; ":   Eq. of T
(s) = "; Ep
PRINT "     Daylight Period (h) ="; Q5; "                          [Alt-S
to end]";

GOSUB 39
Ea = ABS(E2) * SGN(E2)
Eb = E2 - Ea
Eq = Ea * 60 + Eb
Ec = Eq + TIMER + L6 * 60
Es = INT(Ec)   'Sun Time
IF Es > 86400 THEN Es = (Es - 86400)
IF Es <= 0 THEN Es = (Es + 86400)
Ks = INT(TIMER)
Ep = CINT(Eq)

PRINT
 Nk = Ks / 60: Nk = CINT(Nk)
 Jk = Nk / 60: Hk = INT(Jk)
 Qk = (Jk - Hk) * 60: Qk = CINT(Qk)
 Y$ = ":"
 Ns = Es / 60: Ns = CINT(Ns)
 Js = Ns / 60: Hs = INT(Js)
 Qs = (Js - Hs) * 60: Qs = CINT(Qs):
 PRINT
PRINT "     True Time ="; Hs; Y$; Qs; " **  Std Time ="; Hk; Y$; Qk; "     
    (24 hr.
format)"


 REM Rd1 calc.:Ht of horiz..
 Hd1 = Q5 / 2: Nd = Hd1 * 60 + 720: Rd1 = Nd / 1440 * 2 * PI
 Rd1y = COS(Rd1) * 170: Rdy = Rd1y + 280

 IF Rdy < Rsy THEN gs = 1:  'Changes True Sun color fill
 IF Rdy >= Rsy THEN gs = 14
LINE (0, 80)-(640, 80), 0
LINE (0, Rdy)-(640, Rdy), 0: PAINT (638, 2), 0
PAINT (2, 82), 9, 0
LINE (150, 280)-(490, 280), 13
LINE (320, 110)-(320, 450), 13

Ra1 = Ns / 1440 * 2 * PI: Rax = SIN(Ra1) * 170: Ray = COS(Ra1) * 170
Rsx = 320 - Rax: Rsy = 280 + Ray

Ra2 = Nk / 1440 * 2 * PI: Ra2x = SIN(Ra2) * 170: Ra2y = COS(Ra2) * 170
Rkx = 320 - Ra2x: Rky = 280 + Ra2y

CIRCLE (320, 280), 170, 13
CIRCLE (Rkx, Rky), 3, 15
CIRCLE (Rsx, Rsy), 3, 12: PAINT (Rsx, Rsy), gs, 12
 IF INKEY$ = CHR$(0) + CHR$(31) THEN 100
SLEEP 15
GOTO 30

39 REM Typical year (1982) gives values suitable for fixed dials
54 D1 = M2(N1%) + N2% + (12 + L4 / 15) / 24
56 L2 = 4.87533 + D1 * .0172028
58 G = 6.22578 + D1 * .017202
60 L1 = L2 + SIN(G) * .0334406 + SIN(2 * G) * .0003491
62 S5 = SIN(L1) * .3978105
64 D4 = 2 * ATN(S5 / (1 + SQR(1 - S5 * S5)))
68 D5 = D4 * 57.29579
70 D5 = SGN(D4) * INT(ABS(D5) * 100 + .005) / 100
72 A1 = .91747 * TAN(L1): A2 = ATN(A1)
74 J = L2 - A2
76 IF J < -.7853982 THEN A2 = A2 - 1.570796: GOTO 74
78 IF J > .7853982 THEN A2 = A2 + 1.570796: GOTO 74
80 E = 4 * (L2 - A2) * 57.29579
82 E2 = SGN(E) * CINT(ABS(E) * 100 + .005) / 100
 REM Solve for Day Length
 Q1 = TAN(D4) * TAN(L3 * .0174533)
 Q2 = 1 - Q1 * Q1
 Q3 = Q1 / SQR(Q2): Q3 = ATN(Q3)
 Q4 = Q3 * 3.819719: Q5 = INT(10000 * (2 * Q4 + 12)) / 10000

RETURN
100 END
 DATA "JAN ", 0, "FEB ", 31, "MAR ", 59, "APR ", 90
 DATA "MAY ",120,"JUN ",151,"JUL ",181,"AUG ",212
 DATA "SEP ",243,"OCT ",273,"NOV ",304,"DEC ",334
 END

=========================================

Reply via email to