Version 20 of An arc clock

Updated 2008-05-15 04:01:07 by Stu

if 0 {Richard Suchenwirth 2004-12-25 - I don't know why, but this Xmas somehow unusual clocks interest me most. Here's a very simple one with 24 hour display (the black/white disk) plus minutes (the red arc running round the disk).

WikiDbImage arcclock.gif

Black and white obviously stand for day and night; by the angle of the black/white divide you can tell the hour (noon is horizontal with white up, midnight is horizontal with black up) measured at top of the disk. The minute display allows reading at roughly 5 minutes precision. The screenshot was taken at 11:49.

The GUI is just a canvas with three items: }

 package require Tk

 pack [canvas .c -width 60 -height 60]
 .c create arc 5 5 55 55 -fill red -outline red \
    -start 90 -tag min
 .c create oval 10 10 50 50 -fill white -outline white
 .c create arc 10 10 50 50 -fill black -extent 180 -tag night

#-- I need this every now and then :)

 proc every {ms body} {eval $body; after $ms [info level 0]}

 proc update'arc'clock w {
    scan [clock format [clock sec] -format %H] %d hour
    scan [clock format [clock sec] -format %M] %d minute
    $w itemconfig night -start [expr ($hour+$minute/60.)*-15]
    $w itemconfig min -extent [expr $minute*-6]
 }





 every 1000 {update'arc'clock .c}

 bind . <Escape> {exec wish $argv0 &; exit}

rmax - Here is a slight variation of update'arc'clock that uses the red arc to represent both, minutes and seconds:}

 proc update'arc'clock w {
    set sec [clock sec]
    scan [clock format $sec -format %H] %d hour
    scan [clock format $sec -format %M] %d minute
    scan [clock format $sec -format %S] %d second
    $w itemconfig night -start [expr ($hour+$minute/60.)*-15]
    $w itemconfig min -start [expr $minute*-6+90]
    $w itemconfig min -extent [expr (60-$minute+$second)*-6]
 }

Too bad no one got you a Time By Design [L1 ] watch for Christmas ;) This is somewhat like their pie watch. - RS can't see that page, as it requires a Flash player - but I'm less interested in consumer goods than in the freedom of being my own clockmaker :^) A happy new year to all!


rdt As usual with your projects, this is great. It would be nice if the half-white/half-black could reflect the actual daylight/nightime ratio. But I don't know how to even get that information. Maybe even show the dusk/dawn time period in gray? Of course for those above the arctic circle it might be a pain. - RS:) Hm.. The day/night ratio is 1:1 on the equinoxes (21 March/21 Sep), and depending on hemisphere varies on other dates. But I thought it is challenging enough for the user to estimate the angle of a straight line in 15 degrees units (360 degrees/24 h)... rdt Well, you certainly are right about that. I was thinking about one pixel tick marks around the edge of the circle with noon/midnight being 3 pixel lines. But, I guess thats a bit too much work. Anyone know where to get or calculate the dawn, sunrise, dusk, sunset times?


See also A little A-D clock - A base-5 clock


[ Category Date and Time | Arts and crafts of Tcl-Tk programming ]