Message Boards Message Boards

Freezing part of a geometric figure in Manipulate

Posted 8 months ago

Hi everybody, Here is an oversimplified figure : a square of side b=1 is diagonally divided into 4 parts. Each triangle is then rotated by Pi around a different vertex. Manipulate does the job, however the size of the initial square varies but I want it to remain unchanged. I have tried various options in Graphics without success. Any idea ? Thanks in advance !

b=1;
tr[1] = Line[{{-b/2, b/2}, {0, 0}, {-b/2, -b/2}, {-b/2, b/2}}];
tr[2] = Line[{{-b/2, b/2}, {b/2, b/2}, {0, 0}, {-b/2, b/2}}];
tr[3] = Line[{{b/2, b/2}, {b/2, -b/2}, {0, 0}, {b/2, b/2}}];
tr[4] = Line[{{b/2, -b/2}, {-b/2, -b/2}, {0, 0}, {b/2, -b/2}}];

Manipulate[Graphics[{tr[1], tr[2], tr[3], tr[4],
   Red, Rotate[tr[1], -u, {-b/2, b/2}],
   Rotate[tr[2], -u, {b/2, b/2}],
   Rotate[tr[3], -u, {b/2, -b/2}],
   Rotate[tr[4], -u, {-b/2, -b/2}]}], {u, 0, Pi}]
POSTED BY: André Hautot
2 Replies

Give a suitably large PlotRange, for example PlotRange -> 1.5.

POSTED BY: Gianluca Gorni
Posted 8 months ago

Indeed, Thanks a lot Gianluca Andre

POSTED BY: André Hautot
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract