Zigzags


The patterns above all arise from the same simple rule, which generates a zigzagging red and blue line. The pattern that you get depends on three whole numbers: two angles, the zig angle and the zag angle; and one length, the zag length. Before you try to understand how the zigzags are drawn, experiment with the program below, changing these three values to see what range of patterns you can create. You can increase and decrease the angles by one degree by pushing the Zig+, Zig-, Zag+, and Zag- buttons, or you can type values directly into the boxes (if you do this, you'll need to press ENTER before the picture is updated).

Notice that changing the angles by just one degree can have a dramatic effect on the pattern. Changing the zag length a little bit, on the other hand, has a much less marked effect.


1. How zigzags are constructed

The zigzag is made up of alternate zigs (drawn in blue), and zags (drawn in red): each zag starts at the end of the previous zig, and each zig at the end of the previous zag. The length of each zig is taken to be 100 units; the length of each zag is the zag length which you specify. (If you're interested, you can click here for an explanation of why you don't get to choose the zig length).

The first zig and the first zag are drawn horizontally. After that, the angle of each zig to the horizontal increases by the zig angle at each step, and the angle of each zag to the horizontal increases by the zag angle. Thus if the zig angle is 45 degrees and the zag angle is 9 degrees, then the third zig is at an angle of 90 degrees to the horizontal (i.e. it goes vertically upwards), while the third zag is at an angle of 18 degrees to the horizontal.

To understand this, it's easiest to look at a simple example, such as the one below. Here, the zig angle is 45 degrees, the zag angle is 9 degrees, and the zag length is 50. The full zigzag is shown on the left below: to see it drawn slowly one step at a time, click the Start button on the right hand side below.

Notice that

Something else you will have noticed if you kept watching it for long enough is that the zigzag eventually closes up (in fact, after 40 successive zigs and zags). This always happens, in at most 360 steps: the program you were experimenting with earlier displays the total number of steps needed before the zigzag closes up. You can click here to understand why it always closes, and how many steps it takes (this isn't all that easy...)


Problem 1

Try to work out the angles and length which produce each of the following four figures. You can check your answers with the program at the top of the page.

Try to do it without help to start with: if you can't then click here to get some hints. The last one is much harder. If you can do it now you're a real expert; if not, you may find it easier after the next step.


2. Cusps in the zigzag

Some interesting shapes with cusps (sharp corners) can be obtained by changing the Zig angle and Zag angle, starting with both equal to 1 degree. Experiment with the program below, changing the angles by 1 degree at a time (using the Zig+ ,Zig-, Zag+, and Zag- buttons), to try to work out the connection between the two angles and the number of cusps that you get. You're allowed to make the angles negative: ignore the error message that you get when the angles pass through zero. (Why do you think the program won't draw a zigzag when one of the angles is 0?) It's probably best to keep both of the angles between -6 and 6.

When you think you understand the connection between the angles and the number of cusps, try to predict the number of cusps you'll get for each of the following choices of zig angle q1 and zag angle q2:
a) q1 = 3, q2 = 1;       b)q1 = 2, q2 = -3;       c) q1 = 2, q2 = -4.

Check your answers by setting these values in the program. If you got part c) wrong, then you're in good company! Try to refine your formula for the number of cusps. Hint: think about highest common factors (also known as greatest common divisors): the highest common factor of two numbers is the biggest number which divides exactly into both of them (so, for example, the highest common factor of 2 and -4 is 2).

Problem 2

Write down the formula which gives the number of cusps in terms of the zig angle and the zag angle.

3. Rounding the cusps

Getting cusps in the above depends on having the zag length equal to 100. If you change it, the cusps get `rounded off': this can happen in two different ways, depending on whether the zag length is bigger than or less than 100. Set the angles in the program above so that you get a zigzag with 4 or 5 cusps, and then see what happens when you set the zag length to 75; and what happens when you set it to 125. What happens to the rounding when you take other values less than 100 or bigger than 100 (for example, 80 or 120)? Can you now work out how to create that tricky ellipse from earlier on?

Problem 3

To test your new expertise, see if you can find the angles and length which give zigzags looking like each of the following: you'll probably need to do some experiments to get the right answers.


4. The envelope of Zags

Here's some light relief to end with, leaving out all the tricky questions. The pictures above are different from the ones you've seen so far in three ways:

Many beautiful "envelope" patterns are formed this way, and understanding the mathematics behind them is very interesting. Try experimenting with the program below to see what patterns you can form.