Overlay grids of points and see patterns emerge.
Run the code to make an array of points. Try increasing the size from 3:
This draws a grid of 9 points:
An easier way to make a grid of points is with Table.
This makes a grid of points where x and y vary from -1 to 1 in steps of 1:
This draws the grid:
Put more points in the grid by changing 1 to 3:
Change the size of the grid with a slider:
Make anything interactive with Manipulate.
To make the grid interactive, replace the 3s with the variable n, wrap the Graphics expression with Manipulate and specify that n varies from 3 to 10 in steps of 1. Now you can change the size of the grid by dragging the slider:
Include a second grid, rotated by 30 degrees. Try rotating by different amounts—for example, 45 degrees:
Use With to give the table of points the name points (this will make the next steps easier):
Rotate the points by 30 degrees:
Draw the unrotated and rotated points together:
Allow the angle to be varied interactively:
This gives two interactive grids rotated 30 degrees from each other:
Add an angle control by replacing 30 with the variable angle and specifying that the angle varies from 0 to 180:
Share It—Make an interactive website for exploring moiré patterns:
Deploy the Manipulate to the Wolfram Cloud, where anyone with a browser can use it:
Click the link in the output to visit the site.
Tell the world about your creation by sharing the link via email, tweet or other message.