Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ps = {p1, p2,
- p3} = {{Sqrt[3]/4, 0}, {-Sqrt[3]/4, -0.5}, {-Sqrt[3]/4, 0.5}};
- min[\[Theta]_] := Piecewise[{
- {Norm[ps[[1]]], -Pi/3 < \[Theta] < Pi/3}
- },
- 0
- ];
- graphics[\[Theta]_] := ({
- {
- FaceForm[Directive[Opacity[0.33], RGBColor[0.5, 0.7, 0.8]]],
- EdgeForm[Black],
- Disk[#, 1] & /@ ps
- },
- Point[Mean[ps]],
- PointSize[Large],
- Darker@Red,
- Thickness[0.003],
- Piecewise[
- {{
- {
- Point[p1],
- Line[{p1 - 10 {Sin[\[Theta]], Cos[\[Theta]]},
- p1 + 10 {Sin[\[Theta]], Cos[\[Theta]]}}],
- Line[{p1 -
- 10 {Sin[\[Theta]],
- Cos[\[Theta]]} - {Cos[\[Theta]], -Sin[\[Theta]]},
- p1 + 10 {Sin[\[Theta]],
- Cos[\[Theta]]} - {Cos[\[Theta]], -Sin[\[Theta]]}}],
- RGBColor[0, 0.3, 0.4],
- Line[{
- p1,
- p1 - {Cos[\[Theta]], -Sin[\[Theta]]}
- }]
- }
- ,
- -Pi/6 <= \[Theta] < Pi/6
- },
- {
- With[{\[Phi] = \[Theta] + Pi},
- {
- Point[p3],
- Line[{p3 - 10 {Sin[\[Phi]], Cos[\[Phi]]},
- p3 + 10 {Sin[\[Phi]], Cos[\[Phi]]}}],
- Line[{p3 -
- 10 {Sin[\[Phi]],
- Cos[\[Phi]]} - {Cos[\[Phi]], -Sin[\[Phi]]},
- p3 + 10 {Sin[\[Phi]],
- Cos[\[Phi]]} - {Cos[\[Phi]], -Sin[\[Phi]]}}],
- RGBColor[0, 0.3, 0.4],
- Line[{
- p3,
- p3 - {Cos[\[Phi]], -Sin[\[Phi]]}
- }]
- }
- ]
- ,
- Pi/6 <= \[Theta] <= Pi/2
- }
- },
- {}
- ]
- });
- Manipulate[
- Graphics[
- Rotate[
- graphics[\[Theta]],
- \[Theta] - Pi/2,
- Mean[ps]
- ]
- , PlotRange -> 2, ImageSize -> 500],
- {\[Theta], -Pi/6, Pi/2}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement