Advertisement
Guest User

Untitled

a guest
Mar 10th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. StepA = 1;
  2. LimA = 20;
  3. StepB = 4;
  4. LimB = 6;
  5. Raio = 0.5;
  6. EspSetas = 0.01;
  7. Pos1[x_, y_] := -x
  8. Pos2[x_, y_] := y + If[OddQ[(x)], 0, StepB/2]
  9. t = 0;
  10.  
  11. myring[a_, b_] :=
  12. Graphics[Rotate[
  13. Arrow@Table[{-Pos1[a, b] + Raio*Cos[u],
  14. Pos2[a, b] + Raio*Sin[u]}, {u, 0, 2 \[Pi] + t*2 \[Pi]/180,
  15. 2 \[Pi]/180}], {{-1, 0}, {1, 0}}]];
  16.  
  17. myRingSet =
  18. Show[Table[myring[a, b], {a, 0, LimA, StepA}, {b, 0, LimB, StepB}]];
  19. a = Graphics[{{Red, Opacity[1],
  20. Table[Circle[{Pos1[a, b], -Pos2[a, b]}, 0.8*Raio], {a, 0, LimA,
  21. StepA}, {b, 0, LimB, StepB}]}, {Thickness[0.01],
  22. Table[Arrow[{{Pos1[a, b], -Pos2[a, b]}}], {a, 0, LimA,
  23. StepA}, {b, 0, LimB, StepB}]}}];
  24.  
  25. s = Show[a, myRingSet, ImageSize -> 400,
  26. BaseStyle -> Arrowheads[0.014], Frame -> True, FrameTicks -> None,
  27. Axes -> False];
  28.  
  29. ao = AbsoluteOptions[a, PlotRange];
  30.  
  31. Manipulate[
  32. Show[s, PlotRange -> {{i, i - Subtract @@ ao[[1, 2, 1]]/2},
  33. ao[[1, 2, 2]]}, PlotRangePadding -> 1], {i, Min @@ ao[[1, 2, 1]],
  34. Max @@ ao[[1, 2, 1]] + Subtract @@ ao[[1, 2, 1]]/2}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement