Spirograph

HTML version by Eduardo Virueña Silva


Introduction

This is a program that emulates a toy that my parents bought me when I was a little boy: the Spirograph (I suppose this name is somebody's trade mark, but I do not know whose, Hasbro, Kenner perhaps).

In the bottom of this page there is form to pass parameters to the program.

The parameters

The Spirograph creates a GIF with dimensions: SizeX x SizeY pixels.

A Spirograph is basically two gears, one that is called ring, inside which another one -the disc- rolls. In the disc there are holes in them one can put a pen of some color. The spirograph has a rational relation between the radii of the disc and the ring, therefore, it eventually completes a cycle.

In the spirograph, it is suggested to shift one cog the disc and begin another cycle. Let suposse the ring has always 360 cogs. The number of cogs you want to shift is what we are going to call deviation.

Now it is obvious the name of the parameters in the left side of the form. Once the cycle is completed, the spirograph automatically increments its parameters according the values in the right side of the form. Increments can be positive, negative, or zero.

What does a negative value for disc mean? Of course, the disc is rolling in the outter side of the ring.

The color is formed with three components Red, Green, and Blue. Think in color as a vector with three components but write it as a hexadecimal number of 6 digits. Now it is easier to understand how the increment acts: as a vector addition. But keep in mind that components must be in the range [0..255] = [0..0xFF], so, the program forces this using arithmetic modulo 256.

Bugs and warnings

Be gentle... Michelle is my personal computer, do not force her to make spirograms all day long, I need her for doing many other things.

I have had some problems to save an image by clicking the right button of mouse and using Save this image as... option. I rather use File/Save As option in my browser

Perhaps you would like to read a tutorial, or visit the gallery


The SPIROGRAPH

Size x Size y
Ring Inc Ring
Disc Inc Disc
Hole Inc Hole
Pen Inc Pen
Dev Inc Dev
Res Cycles
And now, go to my new spirograph inside spirograph

This page have been visited a lot of times since June 30th, 1997

References

There is a wonderful page explaining the mathematical concepts of the spirograph with brilliant animations in Java; take a look to the page of our friend,Prof. Aquiles Páramo Fonseca, in Colombia.

e-mail: