Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ball[t_, cut_] :=
- If[t < 0, 0.8 {Sin[t + Pi], Cos[t + Pi]},
- If[t < 0.6/0.8, {-0.8 t, -0.8},
- If[cut, {-0.6, -0.8}, RotationMatrix[-t + 0.6/0.8].{-0.6, -0.8}]]];
- transform[t_, x_] := RotationMatrix[t].x;
- Manipulate[
- GraphicsGrid[{{
- Graphics[Join[
- {Red, Disk[ball[t, False], 0.03], Black,
- Thickness[0.005], Circle[{0, 0}, 0.77], Circle[{0, 0}, 1.03],
- Thin, GrayLevel[0.6]},
- Table[
- Line[{{0, 0},
- 0.77 {Sin[2 Pi i/10 + t], Cos[2 Pi i/10 + t]}}], {i, 1, 10}],
- If[t > 0, {Thick, Red, Line[{{0, -0.8}, ball[t, True]}]}, {}],
- {Black, PointSize[0.01]},
- Table[
- Point[1.04 {Sin[2 Pi i/10 + t], Cos[2 Pi i/10 + t]}], {i, 1,
- 10}]
- ],
- PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}}
- ],
- Show[Graphics[Join[
- {Red, Disk[transform[t, ball[t, False]], 0.03], Black,
- Thickness[0.005], Circle[{0, 0}, 0.77], Circle[{0, 0}, 1.03],
- Thin, GrayLevel[0.6], Line[{{0, 0}, 0.77 {0, -1}}]},
- {Black, PointSize[0.02], Point[1.04 {0, -1}]}
- ],
- PlotRange -> {{-0.4, 0.4}, {-0.7, -1.2}}
- ],
- ParametricPlot[transform[tt, ball[tt, False]], {tt, -1.2, t},
- PlotStyle -> Directive[Thick, Red]]
- ]}}, ImageSize -> {500}]
- ,
- {t, -1.1, 1.1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement