Advertisement
Matthen

Reuleux Triangle

May 15th, 2016
1,257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. ps = {p1, p2,
  2. p3} = {{Sqrt[3]/4, 0}, {-Sqrt[3]/4, -0.5}, {-Sqrt[3]/4, 0.5}};
  3. min[\[Theta]_] := Piecewise[{
  4. {Norm[ps[[1]]], -Pi/3 < \[Theta] < Pi/3}
  5. },
  6. 0
  7. ];
  8. graphics[\[Theta]_] := ({
  9. {
  10. FaceForm[Directive[Opacity[0.33], RGBColor[0.5, 0.7, 0.8]]],
  11. EdgeForm[Black],
  12. Disk[#, 1] & /@ ps
  13. },
  14. Point[Mean[ps]],
  15. PointSize[Large],
  16. Darker@Red,
  17. Thickness[0.003],
  18. Piecewise[
  19. {{
  20. {
  21. Point[p1],
  22. Line[{p1 - 10 {Sin[\[Theta]], Cos[\[Theta]]},
  23. p1 + 10 {Sin[\[Theta]], Cos[\[Theta]]}}],
  24. Line[{p1 -
  25. 10 {Sin[\[Theta]],
  26. Cos[\[Theta]]} - {Cos[\[Theta]], -Sin[\[Theta]]},
  27. p1 + 10 {Sin[\[Theta]],
  28. Cos[\[Theta]]} - {Cos[\[Theta]], -Sin[\[Theta]]}}],
  29. RGBColor[0, 0.3, 0.4],
  30. Line[{
  31. p1,
  32. p1 - {Cos[\[Theta]], -Sin[\[Theta]]}
  33. }]
  34. }
  35. ,
  36. -Pi/6 <= \[Theta] < Pi/6
  37. },
  38.  
  39. {
  40. With[{\[Phi] = \[Theta] + Pi},
  41. {
  42. Point[p3],
  43. Line[{p3 - 10 {Sin[\[Phi]], Cos[\[Phi]]},
  44. p3 + 10 {Sin[\[Phi]], Cos[\[Phi]]}}],
  45. Line[{p3 -
  46. 10 {Sin[\[Phi]],
  47. Cos[\[Phi]]} - {Cos[\[Phi]], -Sin[\[Phi]]},
  48. p3 + 10 {Sin[\[Phi]],
  49. Cos[\[Phi]]} - {Cos[\[Phi]], -Sin[\[Phi]]}}],
  50. RGBColor[0, 0.3, 0.4],
  51. Line[{
  52. p3,
  53. p3 - {Cos[\[Phi]], -Sin[\[Phi]]}
  54. }]
  55. }
  56. ]
  57. ,
  58. Pi/6 <= \[Theta] <= Pi/2
  59. }
  60. },
  61. {}
  62. ]
  63. });
  64. Manipulate[
  65. Graphics[
  66. Rotate[
  67. graphics[\[Theta]],
  68. \[Theta] - Pi/2,
  69. Mean[ps]
  70. ]
  71. , PlotRange -> 2, ImageSize -> 500],
  72. {\[Theta], -Pi/6, Pi/2}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement