Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \[Theta]step = Pi/2;
- nmax = 3;
- point[r_, \[Theta]_] :=
- With[{\[Theta]t = Mod[\[Theta], \[Theta]step, -\[Theta]step/2],
- n = Floor[\[Theta]/\[Theta]step + 1/2]},
- 2 r {Cos[\[Theta]t] (-1)^n,
- Sin[-\[Theta]t]} - {(-1)^(n) Cos[\[Theta]step/2],
- 2 n Sin[\[Theta]step/2]}
- ];
- frame[\[Theta]max_] := (Show[
- Join[{
- Graphics[{
- EdgeForm[], FaceForm[RGBColor[0.0, 0.3, 0.9]],
- Rectangle[{-Cos[\[Theta]step/2], -2 nmax Sin[\[Theta]step/
- 2]}, {Cos[\[Theta]step/2], 0}]
- },
- PlotRange -> {
- 1.5 {-1, 1}, {0.1, -2 nmax Sin[\[Theta]step/2] - 0.1}}
- ]
- },
- Table[
- ParametricPlot[
- point[r, \[Theta]]
- , {\[Theta], 0, \[Theta]max},
- PlotStyle ->
- Lighter@ColorData["RedBlueTones"][1 - 4 r (1 - r)],
- Exclusions -> Mod[\[Theta], \[Theta]step] == \[Theta]step/2,
- Axes -> None],
- {r, 0, 1, 1/30}
- ],
- {Graphics[{
- {FaceForm[White], EdgeForm[],
- Rectangle[{-1.5,
- 0}, {-Cos[\[Theta]step/2], -2 nmax Sin[\[Theta]step/2]}],
- Rectangle[{Cos[\[Theta]step/
- 2], -2 nmax Sin[\[Theta]step/2]}, {1.5, 0}]},
- {Thick, Darker@Red,
- Line[
- Table[
- point[r, \[Theta]max],
- {r, 0, 1, 1/30}
- ]
- ]
- }
- }
- ]}
- ]]);
- Manipulate[
- frame[\[Theta]max],
- {\[Theta]max, 0.01, \[Theta]step nmax}
- ]
Advertisement
Add Comment
Please, Sign In to add comment