Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = 0.25;
- spiral[\[Theta]_] :=
- Exp[ a \[Theta]] {-Sin[\[Theta]], Cos[\[Theta]]};
- s = Integrate[
- Sqrt[D[spiral[\[Theta]t][[1]], \[Theta]t]^2 +
- D[spiral[\[Theta]t][[2]], \[Theta]t]^2], {\[Theta]t, 0, x}];
- tracep[t_, trace\[Theta]_] := Module[{p, dp, n},
- p = spiral[t];
- dp = spiral'[t];
- n = {-dp[[2]], dp[[1]]};
- n = n/Norm[n];
- RotationMatrix[{n, {0, 1}}].(spiral[trace\[Theta]] -
- p) + {s /. {x -> t}, 0}
- ];
- soft[x_] := 0.5 + 0.5 Tanh[7 (x - 0.5)];
- pr = {{-15, 50}, {-12, 20}};
- trace\[Theta]s = {-100, 4, 10};
- cols = Table[
- ColorData["DarkRainbow"][i/Length@trace\[Theta]s], {i,
- Length@trace\[Theta]s}];
- frame[tt_] :=
- Module[{t, op},
- If[tt < 1,
- t = -2 + soft[tt]*12;
- op = 1.0;,
- t = 10 - 12*soft[(tt - 1)];
- op = 1 - (tt - 1)^0.5;
- ];
- Show[
- ParametricPlot[
- tracep[t, \[Theta]]
- , {\[Theta], -10, 10}, PlotRange -> pr, Axes -> None,
- PlotStyle -> Directive[Black]],
- Reverse@Table[
- ParametricPlot[
- tracep[\[Theta], trace\[Theta]s[[i]]],
- {\[Theta], -2 - 0.001, If[tt > 1, 10, t]},
- PlotStyle ->
- If[i == 1, Directive[Opacity[op], Thick, cols[[i]]],
- Directive[Opacity[op], cols[[i]]]]
- ], {i, Length@trace\[Theta]s}]
- ,
- Graphics[{
- {
- Darker@Red,
- Table[
- {
- PointSize[Medium],
- cols[[i]],
- Point[tracep[t, trace\[Theta]s[[i]]]]},
- {i, Length@trace\[Theta]s}]
- },
- Line[{{-5, 0}, {46.106603757811996`, 0}}]
- }]
- ]
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement