Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \[Theta]1[t_] := If[t < 1/3, 0, If[t < 2/3, (t - 1/3) Pi, Pi/3]];
- \[Theta]2[t_] := If[t < 2/3, 2 Pi /3, 2 Pi/3 + (t - 2/3) Pi];
- \[Theta]3[t_] := 4 Pi/3 + Pi If[t < 1/3, t, 1/3];
- ptsF[t_] := If[0 <= t < 1,
- pts = ({Sin[#], Cos[#]} &) /@ {\[Theta]1[t], \[Theta]2[
- t], \[Theta]3[t]},
- If[1 <= t < 2,
- pts = ({Sin[# + Pi + 4 Pi/3],
- Cos[# + Pi + 4 Pi/3]} &) /@ {\[Theta]3[t - 1], \[Theta]1[
- t - 1], \[Theta]2[t - 1]},
- If[2 <= t < 3,
- pts = ({Sin[# + 2 Pi/3], Cos[# + 2 Pi/3]} &) /@ {\[Theta]3[
- t - 2], \[Theta]1[t - 2], \[Theta]2[t - 2]},
- If[3 <= t < 4,
- pts = ({Sin[# + Pi + 0 Pi/3],
- Cos[# + Pi + 0 Pi/3]} &) /@ {\[Theta]3[t - 3], \[Theta]1[
- t - 3], \[Theta]2[t - 3]},
- If[4 <= t < 5,
- pts = ({Sin[# + 4 Pi/3], Cos[# + 4 Pi/3]} &) /@ {\[Theta]3[
- t - 4], \[Theta]1[t - 4], \[Theta]2[t - 4]},
- pts = ({Sin[# + Pi + 2 Pi/3],
- Cos[# + Pi + 2 Pi/3 ]} &) /@ {\[Theta]3[t - 5], \[Theta]1[
- t - 5], \[Theta]2[t - 5]}
- ]
- ]
- ]
- ]
- ];
- cr[t_] := Module[{pts, lengths, c, r},
- pts = ptsF[t];
- lengths = Norm /@ (pts - RotateRight[pts]);
- perimeter = Total[lengths];
- c = {(First /@ pts).RotateRight[lengths]/
- perimeter, (Last /@ pts).RotateRight[lengths]/perimeter};
- r = 0.5 Sqrt[
- Times @@ (lengths + RotateRight[lengths] - RotateLeft[lengths])/
- perimeter];
- {c, r}
- ];
- Manipulate[
- Module[{c, r, pts},
- pts = ptsF[Mod[t, 6, 0]];
- {c, r} = cr[Mod[t, 6, 0]];
- Show[
- Graphics[{
- {Darker@Red, Thick, Circle[{0, 0}, 1]},
- FaceForm[], EdgeForm[Black], Polygon[pts],
- PointSize[Medium],
- EdgeForm[Darker@Blue], FaceForm[RGBColor[0.7, 0.9, 1.0]],
- Disk[c, r],
- Darker@Red, Point[c], {Darker@Blue, Point[pts]},
- }, PlotRange -> 1, ImagePadding -> 10],
- ParametricPlot[
- cr[\[Tau]][[1]], {\[Tau], If[t < 6, 0, t - 6],
- If[t < 6, t, 6.001]}]
- ]
- ],
- {t, 0.001, 12}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement