0
$\begingroup$

Writing:

L = 1;
xc = 1;
yc = 1;
θ = Pi/6;

plot1 = ContourPlot[
   Max[(x - xc) Sin[θ + 0 Pi/3] - (y - yc) Cos[θ + 0 Pi/3],
       (x - xc) Sin[θ + 2 Pi/3] - (y - yc) Cos[θ + 2 Pi/3],
       (x - xc) Sin[θ + 4 Pi/3] - (y - yc) Cos[θ + 4 Pi/3]] == L/(2 Sqrt[3]),
       {x, 0, 2}, {y, 0, 2}, PlotPoints -> 50];

plot2 = Graphics[{EdgeForm[{Red, Thick}], 
                  FaceForm[None], 
                  Rotate[RegularPolygon[{xc, yc}, L/Sqrt[3], 3], θ]}];

Show[plot1, plot2]

I get:

enter image description here

and I just can not understand the reason why the two graphics do not coincide.

$\endgroup$
5
$\begingroup$

If center of rotation not be set up , the triangle will rotated about the center of its bounding box .

(´・ω・`)

 Graphics[{EdgeForm[{Red, Thick}], FaceForm[None], 
      Rotate[RegularPolygon[{xc, yc}, L/Sqrt[3], 3], \[Theta], {1, 1}]}]
$\endgroup$
  • $\begingroup$ I understand, I need to rotate around the center {xc, yc}. Thanks so much! $\endgroup$ – TeM Oct 6 '17 at 8:28
  • 1
    $\begingroup$ If center of rotation not be set up ,the triangle will rotated about the center of its bounding box .(´・ω・`) $\endgroup$ – jiaoeyushushu Oct 6 '17 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.