Home
Help
Forum
Resources
Extensions
FAQ
NetLogo Publications
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

## NetLogo User Community Models

## Spiralator - WHAT IS IT?

Spiralator generates interesting cross-hatched spiral patterns by making incremental changes while repeatedly drawing line segments. Results are often surprising and sometimes quite artistic.

This is a simple model using a single turtle and thus provides a good starting point for learning to program with NetLogo. Despite its simplicity it produces interesting variations, even when settings are altered very slightly.

## HOW IT WORKS

It works by repeatedly:
- drawing a line of length len,
- turning left by an angle of t degrees,
- incrementing length len

## HOW TO USE IT

1) Use the "setup" button to reset the display and initialize the model.
2) Use the "go" button to run the model.

Set the "turn-angle" by using the slider control. Different turn-angles will produce wildly varying results. For example, some interesting spiral patterns are generated using turn-angles of 91, 133, 158, 165, 166, 170, 238, or 239 degrees.

Set the number of line segments to draw using the "num-lines" slider control. Settings between 130 and 160 will generally produce interesting results. When num-lines is set very high, you may begin to see the line-segments begin to 'wrap' as they increase in size with each iteration; this can also result in some interesting effects, but can sometimes get overly cluttered. Adjust to taste for particular setting combinations.

The "increment" control sets how much the line-segment length changes with each iteration. The larger the number, the coarser the change with each iteration. In general, a setting of 0.1 or 0.2 should work well for most model runs.

The "color-num" control sets the line color. If "color-shift" is switched on, then it sets the starting line color used before shifting begins. A color-num of 8 (white) or 45 (yellow) will work well as a default value.

While switching "color-shift" on can often result in very pretty kaleidoscopic displays, it is often easier to see the resulting cross-hatched patterns when using a non-shifted single color.

## THINGS TO NOTICE

Pronounced differences result from small changes in the "turn-angle" setting. Observe the difference, for example, between a turn-angle of 165 and 166.

Results tend to become more interesting as the turn-angle approaches or exceeds 90 degrees, as the ever-growing line segments turn back on themselves.

Turn-angle settings below 90 will generally produce less interesting results. As the turn-angle lowers and the turns become more open you may want to lower the number of line segments.

Certain turn-angle settings (e.g. 90, 120, 144, etc) will produce distinctly non-spiral-ish results. This is understandable when you think carefully about the angles involved and their effect on the line-drawing algorithm used.

## EXTENDING THE MODEL

Consider:
- decrementing as well as incrementing line length
- shifting the turn-angle while running
- experimenting with different line-widths
- shifting colors in varying ways as the model runs
- further altering the line-increment amounts
- adding turtles for overlapping/intersecting patterns

## CREDITS AND REFERENCES

Created by David Slauson.