Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- smoothstep[t_, t0_, t1_] := With[{tt = (t - t0)/(t1 - t0)},
- If[tt < 0, 0, If[tt > 1, 1, 6 tt^5 - 15 tt^4 + 10 tt^3]]
- ];
- a = 0.312;
- p[\[Theta]_] :=
- Exp[a \[Theta]] {Sin[\[Theta]], -Cos[\[Theta]]}/Exp[2 Pi a]
- radius[\[Theta]_] := (
- (E^(3 Re[
- a (-2 \[Pi] + \[Theta])]) (Abs[-a Cos[\[Theta]] +
- Sin[\[Theta]]]^2 + Abs[Cos[\[Theta]] + a Sin[\[Theta]]]^2)^(
- 3/2))/(\[Sqrt](-(a + a^3)^2 E^(4 a (-2 \[Pi] + \[Theta])) +
- E^(4 Re[a (-2 \[Pi] + \[Theta])]) (Abs[-a Cos[\[Theta]] +
- Sin[\[Theta]]]^2 +
- Abs[Cos[\[Theta]] + a Sin[\[Theta]]]^2) (Abs[
- Cos[\[Theta]] - a^2 Cos[\[Theta]] + 2 a Sin[\[Theta]]]^2 +
- Abs[2 a Cos[\[Theta]] + (-1 + a^2) Sin[\[Theta]]]^2)))
- );
- norm[\[Theta]_] := {E^(
- a (-2 \[Pi] + \[Theta])) (a Cos[\[Theta]] - Sin[\[Theta]]),
- E^(a (-2 \[Pi] + \[Theta])) (Cos[\[Theta]] + a Sin[\[Theta]])};
- \[Theta][s_] := Log[1 + (a E^(2 a \[Pi]) s)/Sqrt[1 + a^2]]/a;
- maxS = (Sqrt[1 + a^2] E^(-2 a \[Pi]) (-1 + E^(2 a \[Pi])))/a;
- rolledP[\[Theta]t_,
- s_] := (RotationMatrix[{norm[\[Theta][maxS Mod[s, 1]]], {0,
- 1}}].(p[\[Theta]t] - p[\[Theta][maxS Mod[ s, 1]]])
- + {maxS s, 0} +
- Floor[s] {-0.25592425837353455`, 0.8201906184288752`});
- offset[t_] := {maxS/2, 0} (1 - smoothstep[t, 2, 3]) +
- smoothstep[t, 2, 3] (
- rolledP[-1000, -smoothstep[t, 3, 4] (t - 3)] + {0.2, -0.45}
- );
- zoom[t_] := 1 + 0.5 smoothstep[t, 3, 4];
- proj[p_, t_] := (p - offset[t]) zoom[t];
- rolledP2[\[Theta]t_,
- s_] := (RotationMatrix[{norm[\[Theta][
- maxS Mod[s, 1]]], {0, -1}}].(p[\[Theta]t] -
- p[\[Theta][maxS Mod[s, 1]]])
- + {2.8 - maxS s, 0} -
- Floor[s] {-0.25592425837353455`, 0.8201906184288752`});
- frame[t_] := (
- Show[
- Graphics[{
- White,
- {
- Opacity[1 - smoothstep[t, 2.5, 3]],
- Thickness[0.003],
- Line[{proj[{-10, 0}, t], proj[{10, 0}, t]}]
- },
- EdgeForm[], FaceForm[White],
- With[{tt =
- smoothstep[t, 0, 1] - smoothstep[t, 2, 3] -
- smoothstep[t, 3, 4] (t - 3)},
- {
- RGBColor[0.75, 0.22, 0.],
- Polygon[
- Table[(
- proj[
- rolledP[\[Theta]t, tt], t]
- ), {\[Theta]t, 0, 2 Pi, 0.1}]],
- {Black, Disk[proj[rolledP[-1000, tt], t], 0.04]},
- White, Thickness[0.004],
- If[tt > 0,
- Line[{proj[rolledP[-1000, 0], t],
- proj[rolledP[-1000, tt], t]}],
- {}
- ]
- }
- ],
- With[{tt = smoothstep[t, 1, 2] + smoothstep[t, 3, 4] (t - 3)},
- {
- RGBColor[0.19, 0.75, 1.],
- Polygon[
- Table[(
- proj[
- rolledP2[\[Theta]t, tt], t]
- ), {\[Theta]t, 0, 2 Pi, 0.1}]],
- {Black, Disk[proj[rolledP2[-1000, tt], t], 0.04]},
- {
- Opacity[1 - smoothstep[t, 2.5, 3]],
- Thickness[0.004],
- White,
- If[tt > 0,
- Line[{proj[rolledP2[-1000, 0], t],
- proj[rolledP2[-1000, tt], t]}],
- {}
- ]
- }
- }
- ]
- }
- ],
- PlotRange -> 2.5, Background -> Black, ImageSize -> 500
- ]);
- Manipulate[
- frame[t],
- {t, 0, 6}
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement