Message Boards Message Boards

Moiré Explorer

Here's a fun Manipulate for exploring Moiré patterns:

Manipulate[
 Overlay[{graphic, Rotate[graphic, r Degree]}, 
  Alignment -> offset], {{dimension, 10, "Dimension"}, 5, 200, 
  1}, {{r, 5, "Rotation"}, 0, 
  200}, {{offset, {0, 0}, "Offset"}, {-1, -1}, {1, 1}}, {{reset, Null,
    ""}, Button["Reset Offset", offset = {0, 0}] &}, {{graphic, 
   Dynamic@lineset[dimension], 
   "Graphic"}, {Dynamic@lineset[dimension] -> "Lines", 
   Dynamic@grid[dimension] -> "Grid", 
   Dynamic@insetcircles[dimension] -> "Inset Circles"}, SetterBar}, 
 Initialization :> (lineset[dim_] := 
    Graphics[{Thickness[1/(dim*2)], 
      Table[Line[{{x, 0}, {x, 1.5*dim}}], {x, 0, dim, 1}]}];
   grid[dim_] := 
    Graphics[{Thickness[1/(dim*4)], 
      Table[Line[{{x, 0}, {x, dim}}], {x, 0, dim, 1}], 
      Table[Line[{{0, y}, {dim, y}}], {y, 0, dim, 1}]}]; 
   insetcircles[dim_] := 
    Graphics[{Thickness[1/(dim*2)], 
      Table[Circle[{0, 0}, r], {r, 0, dim, 2}]}];)]
POSTED BY: Jesse Friedman

Very neat, Jesse! Have you see Moire' at Deomnstrations?

POSTED BY: Sam Carrettie
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