HTML version by Eduardo Virueña Silva
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 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.
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
This page have been visited a lot of times since June 30th, 1997
e-mail: