- 积分
- 133
- 注册时间
- 2006-1-10
- 仿真币
-
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2007-7-28 22:24:34
|
显示全部楼层
来自 江苏无锡
I add one line to show digital clock on top.
- makeHand[fl_, bl_, fw_, bw_] :=
- Polygon[{{-bw, -bl}, {bw, -bl}, {fw, fl}, {0, fl + 8 fw}, {-fw,
- fl}}/9];
- hourHand = makeHand[5, 5/3, .1, .3];
- minuteHand = makeHand[7, 7/3, .1, .3];
- secondHand = {Red, EdgeForm[Black], makeHand[7, 7/3, .1/2, .3/2]};
- Graphics[{
- (* Construction *)
- {Thickness[.03], Circle[]},(* Rim *)
- {Thickness[.003],
- Table[Line[{.9 {Cos[a], Sin[a]}, .95 {Cos[a], Sin[a]}}], {a, 0,
- 2 \[Pi], 2 \[Pi]/60}]}, (* Thin ticks *)
- {Thickness[.01],
- Table[Line[{.9 {Cos[a], Sin[a]}, .95 {Cos[a], Sin[a]}}], {a, 0,
- 2 \[Pi], 2 \[Pi]/12}]}, (* Thick ticks *)
- Style[
- Table[Text[
- i, .77 {Cos[-i \[Pi]/6 + \[Pi]/2],
- Sin[-i \[Pi]/6 + \[Pi]/2]}], {i, 1, 12}],
- FontFamily -> "Helvetica", FontSize -> 36], (* Numbers *)
-
- (* Digital Time *)
- Style[Text[
- Dynamic[Refresh[DateString[], UpdateInterval -> 1/20]], {0,
- 1.15}], Blue, FontFamily -> "Helvetica", FontSize -> 20],
-
- (* Define three hands *)
- Rotate[hourHand,
- Dynamic[Refresh[-30 Mod[AbsoluteTime[]/3600, 60] °,
- UpdateInterval -> 60]], {0, 0}],
- Rotate[minuteHand,
- Dynamic[Refresh[-6 Mod[AbsoluteTime[]/60, 60] °,
- UpdateInterval -> 1]], {0, 0}],
- Rotate[secondHand,
- Dynamic[Refresh[-6 Mod[AbsoluteTime[], 60] °,
- UpdateInterval -> 1/20]], {0, 0}]
- }]
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|