Here's an example: suppose that the zig angle is 60 degrees. Then (ignoring the zags altogether), successive zigs look like this:
So after 6 steps, the total effect of the six zigs is to have done nothing at all. Here are some other examples, with zig angles 72, 120, 144, and 117 degrees respectively
What about when q1 = 144? This doesn't divide exactly into 360, but 5×144 = 720, which is twice 360, and so the zigs get back to their starting point every 5 steps.
For a general zig angle q1, the number of steps to return to the starting point is therefore the smallest number n which, when multiplied by q1, gives a multiple of 360. To work out what this is, we have to consider what part of 360 is already `contained' in q1: that is, the greatest common divisor (or highest common factor) of 360 and q1: this is often written gcd(360,q1). Since the gcd is already contained in q1, we only need to multiply q1 by 360/gcd(360,q1) to get a multiple of 360. That is
|
Check this formula for the zig angles 60, 72, 120, and 144 shown above. How many steps does it take to return to the start when q1 = 117?
Notice that the worst possible case is that it takes 360 steps for the zigs to get back to the start: this happens when the gcd of 360 and q1 is equal to 1 (i.e. 360 and q1 have no common factors).
Now lets bring the zags back into the discussion. Suppose that the zig angle q1 is 60, and the zag angle q2 is 72. Then the zigs get back to their starting place every 6 steps, and the zags get back to their starting place every 5 steps. For the zigzag to close up, both the zigs and the zags need to be back where they started. The zigs are back home after 6, 12, 18, 24, 30, 36, ... steps, and the zags are back home after 5, 10, 15, 20, 25, 30, ... steps. Thus the first time they're both back home together is after 30 steps. You can check this out on the program below: if you set the zig angle to 60 and the zag angle to 72, the zigzag will close after 30 steps, no matter what the zag length is.
Can you find a general formula for the number of steps it takes for the zigzag to close? The formula involves greatest common divisors again. It's unlikely you'll be able to work out the answer without doing some experiments on the program above. Try out some values for the zig angle and zag angle, and notice how many steps there are in the zigzag. Pay special attention to the cases where there are fewer than 360 steps: in these cases, how many times does the number of steps divide into 360? How is this related to the zig angle and the zag angle?
When you have a guess for the answer, test it out by working out the number of steps it takes to close when the zig angle is 72 and the zag angle is 231: check your answer on the program above.