_
_
00 : 00 : 0.0 ( Parallel)
00 : 21 : 42.0 ( 120 degrees)
00 : 32 : 44.0 ( Anti-parallel)
01 : 05 : 27.0 ( Parallel)
01 : 26 : 47.0 ( 120 degrees)
01 : 38 : 11.0 ( Anti-parallel)
01 : 49 : 29.0 ( 120 degrees)
02 : 10 : 55.0 ( Parallel)
02 : 32 : 53.0 ( 120 degrees)
02 : 43 : 38.0 ( Anti-parallel)
02 : 54 : 35.0 ( 120 degrees)
03 : 16 : 22.0 ( Parallel)
03 : 37 : 58.0 ( 120 degrees)
03 : 49 : 5.0 ( Anti-parallel)
03 : 59 : 40.0 ( 120 degrees)
04 : 21 : 49.0 ( Parallel)
04 : 44 : 4.0 ( 120 degrees)
04 : 54 : 33.0 ( Anti-parallel)
05 : 27 : 16.0 ( Parallel)
05 : 49 : 9.0 ( 120 degrees)
06 : 00 : 0.0 ( Anti-parallel)
06 : 10 : 51.0 ( 120 degrees)
06 : 32 : 44.0 ( Parallel)
07 : 05 : 27.0 ( Anti-parallel)
07 : 15 : 56.0 ( 120 degrees)
07 : 38 : 11.0 ( Parallel)
08 : 00 : 20.0 ( 120 degrees)
08 : 10 : 55.0 ( Anti-parallel)
08 : 22 : 2.0 ( 120 degrees)
08 : 43 : 38.0 ( Parallel)
09 : 05 : 25.0 ( 120 degrees)
09 : 16 : 22.0 ( Anti-parallel)
09 : 27 : 7.0 ( 120 degrees)
09 : 49 : 5.0 ( Parallel)
10 : 10 : 31.0 ( 120 degrees)
10 : 21 : 49.0 ( Anti-parallel)
10 : 33 : 13.0 ( 120 degrees)
10 : 54 : 33.0 ( Parallel)
11 : 27 : 16.0 ( Anti-parallel)
11 : 38 : 18.0 ( 120 degrees)
'nomainwin
WindowWidth =420
WindowHeight =490
open "Analogue Clock" for graphics_nf_nsb as #wg
#wg "trapclose quit"
#wg "font Ubuntu_mono bold 18"
i =0
gosub [bg]
for seconds =0 to 86400 /2 -1 step 1 ' check every 1 second in 12 hr cycle
' 6 degrees per min/sec. 30 degrees per hour
'for seconds =21 *60 +40 to 21 *60 +44 step 1
angleSecs =( 6 *seconds) mod 360 ' second hand position in degrees
angleMins =( 6 *seconds /60) mod 360 ' minute hand position in degrees
angleHrs =( 12 *seconds /60 /24) mod 360 ' hour hand position in degrees
#wg "cls"
#wg "drawbmp scr 1 1"
#wg "color darkblue ; up ; goto 100 445 ; down"
#wg "\" +tme$( seconds)
xH =120 *sinrad( angleHrs): yH =120 *cosrad( angleHrs)
#wg "size 7 ; up ; goto 200 200 ; down ; color red ; goto "; 200 +xH ; " "; 200 -yH
xM =150 *sinrad( angleMins): yM =150 *cosrad( angleMins)
#wg "size 5 ; up ; goto 200 200 ; down ; color cyan ; goto "; 200 +xM ; " "; 200 -yM
xS =160 *sinrad( angleSecs): yS =160 *cosrad( angleSecs)
#wg "size 3 ; up ; goto 200 200 ; down ; color pink ; goto "; 200 +xS ; " "; 200 -yS
nearness0 = angleBetween( angleMins, angleHrs ) ' abs( angleMins -angleHrs)
nearness180 = angleBetween( angleMins, angleHrs ) -180 ' abs( angleMins -angleHrs) -180
HM120 = angleBetween( angleMins, angleHrs ) ' abs( angleMins -angleHrs) -120
SM120 = angleBetween( angleMins, angleSecs) ' abs( angleMins -angleSecs) -120
HS120 = angleBetween( angleHrs, angleSecs) ' ( abs( angleHrs -angleSecs) -120) mod 360
'print int( angleHrs), int( angleMins), int( angleSecs), int( HM120), int( SM120), int( HS120)
'if ( ( abs( HM120) <40) and ( abs( SM120) <40) and ( abs( HS120 ) <40) ) then
if abs( HM120 -120) <3 and abs( SM120 -120) <3 and abs( HS120 -120) <3 then
print tab( 50); tme$(seconds); " ( 120 degrees)"
#wg "color black ; up ; goto 100 445 ; down"
#wg "\" +tme$( seconds)
seconds =seconds +360
call screenGrab i: i =i +10
end if
if abs( nearness0 ) <0.045 then
print tme$( seconds); " ( Parallel)"
#wg "color black ; up ; goto 100 445 ; down"
#wg "\" +tme$( seconds)
seconds =seconds +1
call screenGrab i: i =i +10
end if
if abs( nearness180) <0.045 then
print tab( 25); tme$(seconds); " ( Anti-parallel)"
#wg "color black ; up ; goto 100 445 ; down"
#wg "\" +tme$( seconds)
seconds =seconds +1
call screenGrab i: i =i +10
end if
'CallDLL #kernel32, "Sleep", 20 As ULong, ret As Void
scan
next seconds
wait
function angleBetween( i, j)
if i < j then
temp =i
i =j
j =temp
end if
th1 =i -j
th2 =360 -i +j
angleBetween =min( th1, th2)
end function
function tme$( tSec)
hrs =int( tSec /60 /60)
tSec =tSec -hrs *60 *60
mins =int( tSec /60)
secs =tSec -mins *60
tme$ =" "; right$( "00" +str$( hrs), 2); " : "; right$( "00" +str$( mins), 2); " : "; using( "##.#", secs)
end function
function sinrad( th)
sinrad =sin( th *2 *3.14159265 /360)
end function
function cosrad( th)
cosrad =cos( th *2 *3.14159265 /360)
end function
sub screenGrab i
#wg "flush ; getbmp scr2 1 1 400 440"
bmpsave "scr2", "clockPics/pic" +right$( "000" +str$( i), 3) +".bmp"
end sub
sub quit h$
close #wg
end
end sub
[bg]
#wg "color white"
#wg "size 6 ; fill 50 50 50"
for th =0 to 360 step 30
xSi =180 *sinrad( th): ySi =180 *cosrad( th)
xSj =190 *sinrad( th): ySj =190 *cosrad( th)
#wg "up ; goto "; 200 +xSi; " "; 200 -ySi; " ; down ; goto "; 200 +xSj ; " "; 200 -ySj
next th
#wg "getbmp scr 1 1 420 420"
return