Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Programming: Moiré Patterns

Why do this problem?

There is considerable concern at the moment that students aren't engaging with programming in school at all, and that ICT focuses to much on working with software such as Microsoft Office.  In the words of the BBC's Rory Cellan-Jones, computer programming is "the new Latin".
Programming requires logical thinking, and an ability to problem-solve - both very useful skills for students to practise in as many different contexts as possible.  Girls often see computer programming as a particularly male activity, so making design the focus of programming activities may help to overcome such attitudes.
Logo is an ideal computer language for students to start with, because simple instructions produce an immediate on-screen drawing - so you can see straight away if your instructions are correct.  Because the simplest commands are straight lines and turns, it is also a great way to support students' geometrical thinking.
Logo also has the advantage of being free to download (click here for a PC, and here for a Mac).
Getting started with Logo [Mac version]

Possible approach

Students could start by drawing a line, then a square, then a set of radial lines:

Line: cs fd 100
Square: cs repeat 4[fd 100 rt 90]
Radial lines: cs repeat 8[bk 50 fd 100 bk 50 rt 45]

Can they adapt these to draw a bigger or smaller square or a set of 4 (or 6 or 12) radial lines?

Once students are comfortable with drawing lines and squares, they can try out one of the programs for a Moire pattern, and from there they can go on to develop their own programs.

Key question

What are the best combinations of the number of radial lines, the length of the lines and the angle between the lines to create Moire patterns?  Can you come up with any rules for what works and what doesn't?

Possible extension

Once students know how to program these simple Moire patterns, use the links at the top of the problem page to explore further.

Possible support

If students find it difficult to get started, they could use the programs provided and see what happens if they just change one value.