Advertisement
Matthen

Centrifugal Force

Jun 4th, 2011
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1.  
  2. ball[t_, cut_] :=
  3. If[t < 0, 0.8 {Sin[t + Pi], Cos[t + Pi]},
  4. If[t < 0.6/0.8, {-0.8 t, -0.8},
  5. If[cut, {-0.6, -0.8}, RotationMatrix[-t + 0.6/0.8].{-0.6, -0.8}]]];
  6. transform[t_, x_] := RotationMatrix[t].x;
  7. Manipulate[
  8. GraphicsGrid[{{
  9. Graphics[Join[
  10. {Red, Disk[ball[t, False], 0.03], Black,
  11. Thickness[0.005], Circle[{0, 0}, 0.77], Circle[{0, 0}, 1.03],
  12. Thin, GrayLevel[0.6]},
  13. Table[
  14. Line[{{0, 0},
  15. 0.77 {Sin[2 Pi i/10 + t], Cos[2 Pi i/10 + t]}}], {i, 1, 10}],
  16. If[t > 0, {Thick, Red, Line[{{0, -0.8}, ball[t, True]}]}, {}],
  17. {Black, PointSize[0.01]},
  18. Table[
  19. Point[1.04 {Sin[2 Pi i/10 + t], Cos[2 Pi i/10 + t]}], {i, 1,
  20. 10}]
  21. ],
  22. PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}}
  23. ],
  24. Show[Graphics[Join[
  25. {Red, Disk[transform[t, ball[t, False]], 0.03], Black,
  26. Thickness[0.005], Circle[{0, 0}, 0.77], Circle[{0, 0}, 1.03],
  27. Thin, GrayLevel[0.6], Line[{{0, 0}, 0.77 {0, -1}}]},
  28. {Black, PointSize[0.02], Point[1.04 {0, -1}]}
  29. ],
  30. PlotRange -> {{-0.4, 0.4}, {-0.7, -1.2}}
  31. ],
  32. ParametricPlot[transform[tt, ball[tt, False]], {tt, -1.2, t},
  33. PlotStyle -> Directive[Thick, Red]]
  34. ]}}, ImageSize -> {500}]
  35. ,
  36. {t, -1.1, 1.1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement