0
$\begingroup$

I have a problem. How can I get three arrows in to update simultaneously? All work, but one by one.

wsp = Table[{Cos[x], Sin[x]}, {x, 2 \[Pi]/6, -9 \[Pi]/6, -\[Pi]/6}];
wsp1 = Table[{Cos[x], Sin[x]}, {x, 15 \[Pi]/30, -60 \[Pi]/30, -\[Pi]/30}];
For[n = 1, n <= 12, n++, Pause[1]; g = n]
For[n = 1, n <= 60, n++, Pause[0.2]; h = n]
For[n = 1, n <= 12, n++, Pause[0.1]; j = n]
Graphics[{Table[{ColorData["TemperatureMap", i/12], 
     Disk[wsp[[i]], 0.2], Text[Style[i, Black, Bold], wsp[[i]]]}, {i, 
     1, 12}], , Thick, Black, Arrowheads[Large], 
   Dynamic[Arrow[{{0, 0}, .7 wsp[[g]]}]], 
   Dynamic[Arrow[{{0, 0}, .95 wsp1[[h]]}]], GrayLevel[.3], 
   Dynamic[Line[{{0, 0}, 0.8 wsp[[j]]}]], 
   PlotRange -> {{-1.3, 1.3}, {-1.3, 1.3}}}] // Framed

PS. Dont look at coordinates, i ll correct it :)

$\endgroup$
5
$\begingroup$
sec = 60;
min = 1/60;
hr = 1/60/12;
wsp = Table[{Cos[x], Sin[x]}, {x, 2 \[Pi]/6, -9 \[Pi]/6, -\[Pi]/6}];
Animate[Graphics[{Table[{ColorData["TemperatureMap", i/12], 
 Disk[wsp[[i]], 0.2], Text[Style[i, Black, Bold], wsp[[i]]]}, 
 {i,1, 12}],Thick, Black, Arrowheads[Large], 
  Arrow[{{0, 0}, {Sin[min 2 Pi t], Cos[min 2 Pi t]}}], 
  Arrow[{{0, 0}, 0.8 {Sin[hr 2 Pi t], Cos[hr 2 Pi t]}}], 
 PlotRange -> {{-1.3, 1.3}, {-1.3, 1.3}}}]
, {t, 0, 60}]

enter image description here

$\endgroup$
  • $\begingroup$ Maybe do you know how to add beep[] every hour? i just thought about it: Table[Beep[]; {Cos[x], Sin[x]}, {x, 2 \[Pi]/6, -9 \[Pi]/6, -\[Pi]/6}] but it does not work $\endgroup$ – Karol Apr 17 '16 at 12:11
  • $\begingroup$ Hi @Karol. Try If[Mod[t,60]==0, Beep[]]. I am travelling, so can't evaluate it right now. You may have to use Evaluate. $\endgroup$ – Sumit Apr 19 '16 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.