## Saturday, October 12, 2013

### Spirolaterals in Scratch

Way back in the early 1980s, the first Apple II (Integer BASIC) program I ever saw programmed a pencil and graph paper exploration called Spirolaterals. I had a lot of success using Spirolaterals with middle school and secondary students. I used them to introduce the concept of mathematical conjecture.

The simplest spirolateral is defined as follows:
Start at some grid point on the Cartesian plane.
move forward x steps, turn right 90,
move forward 2x steps, turn right 90,
move forward 3x steps, turn right 90.
move forward 4x steps, turn right 90

move forward nx steps, turn right.

The coefficient of the last x is called the order.
This graphic shows the path of a 4x  or order 4 spirolateral.
The order can be repeated and the number of repetitions is called the cycle. In the following graphic the order 3 spirolateral has been repeated 4 times, starting with the red, then the green, the blue, and finishing with the black order 3.
As is evident in the graphic, the order 3 cycle 4 spirolateral closes. It’s the relationship between order and cycle that can be explored and, by reviewing order-cycle data, a conjecture can be formed.
The following graphic is a screen shot of the Scratch program that just computed the path followed by an order 9 cycle 4 spirolateral.
The second Spirolateral Scratch project mixes left and right turns. This greatly increases the number of patterns an order 5 spirolateral can compute. For example, there are 32 ways to order right and left turns for Order 5. In the graphic below, the right-right-left-right-right pattern for order 5 cycle 4 has been computed.

This project is also a simple exercise for learning about how to store and retrieve data from a list.
If enough data is collected by experiment, patterns in behavior do emerge. In other words, there is a relationship between order and cycle in this project that also leads to a conjecture.
Patterns really begin to get complicated (and even more interesting) when other turns, like 60 degree turns, and both left
and right turns are allowed.
The project Spirolateral Bot 3 implements 60º right turns but can easily be modified to allow turns of any degree and both left and right turns. Doing so would make a nice exercise.
In the graphic, an order 5 cycle 3 spirolateral has been computed.

I do have pdf files for Spirolateral Bots 1 and 2 that go into more detail about programming spirolaterals in Scratch. To request a free copy, send an email to grandadscience@gmail.com