Mathematica带您一起迎接五一

五一假期即将来临,大家是不是特别~~~~?

还有多长时间呢?下面小编带领大家来一起看下

一个自动模拟/数字时钟,wolfram官网上的,拿来借花献佛

Manipulate[

If[

Refresh[DateList[], UpdateInterval -> 1][[4 ;; 5]] == {Hours,

Minutes} && oo,

EmitSound[Sound[SoundNote[note, 1]]]];

Column[{

Graphics[{

{Thickness[.08], Circle[]}, {Opacity[0.66],

Lighter[Blue, 0.88], Disk[]},(* 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}], "Label", 22], (*

Numbers *)

Rotate[hourHand,

Dynamic[Refresh[-30 Mod[AbsoluteTime[]/3600, 60] \[Degree],

UpdateInterval -> 60]], {0, 0}],

Rotate[minuteHand,

Dynamic[Refresh[-6 Mod[AbsoluteTime[]/60, 60] \[Degree],

UpdateInterval -> 1]], {0, 0}],

Rotate[secondHand,

Dynamic[Refresh[-6 Mod[AbsoluteTime[], 60] \[Degree],

UpdateInterval -> 1/10]], {0, 0}], {Yellow, Point[{0, 0}]}},

ImageSize -> {300, 300}, ImageMargins -> 8],

Text@Style[DateString[], 15],

Spacer[{15, 15}]}, Alignment[Center, Top],

ItemSize -> {Automatic, {3, Automatic, 3}}], Delimiter,

{{Hours, 0, "hours"}, Range[25] - 1},

{{Minutes, 0, "minutes"}, Range[61] - 1},

{{oo, True, "alarm"}, {True -> "ON", False -> "OFF"}},

{{note, "D", "select alarm note"}, {"A", "B", "C", "D", "E", "F",

"G"}},

ControlPlacement -> Left,

TrackedSymbols -> True,

AutorunSequencing -> {1, 2, 3},

Initialization :> (

makeHand[fl_, bl_, fw_, bw_] :=

Polygon[{{-bw, -bl}, {bw, -bl}, {fw, fl}, {0, fl + 8 fw}, {-fw,

fl}}/10];

hourHand = makeHand[5, 5/3, .1, .3];

minuteHand = makeHand[7, 7/3, .1, .3];

secondHand = {Pink, EdgeForm[Black], makeHand[7, 7/3, .1/2, .3/2]};

)]

小编在这里提前祝大家节日快乐!

另外还要告诉大家一个好消息,通过微信认证的面向教育的Mathematica订阅号也要向大家推出啦,我们将继续不遗余力的为大家提供与Mathematica的相关的服务和资讯,希望大家继续支持我们哦。扫描下面二维码关注公众号,就有机会获得最新版Mathematica试用版软件哦,还不快快行动!

原文发布于微信公众号 - WOLFRAM(WolframChina)

原文发表时间:2016-04-29

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

扫码关注云+社区

领取腾讯云代金券