Spirograph

The Spirograph applet is written using Java. You must have a Java enabled browser such as Netscape Navigator or Microsoft IE to be able to see this Spirograph applet.

You can display this spirograph on your own homepage. See below.


What is a Spirograph?

A Spirograph is a curve formed by rolling a circle inside or outside of another circle. The pen is placed at any point on the rolling circle. If the radius of fixed circle is R, the radius of moving circle is r, and the offset of the pen point in the moving circle is O, then the equation of the resulting curve is defined by:

x = (R+r)*cos(t) - (r+O)*cos(((R+r)/r)*t)
y = (R+r)*sin(t) - (r+O)*sin(((R+r)/r)*t)


How to use it?

Here is how you can use the controls in this Spirograph applet:


How to put this applet on your homepage?

Embed following HTML code in your page. That's all! Feel free to change the initial values of the radii in the code below. Feel free to drop me a note with the address of the page where you display it.

<APPLET CODEBASE="http://wordsmith.org/anu/java/" CODE="Spiro.class" width=680 height=400>
<PARAM NAME="R" VALUE="20">
<PARAM NAME="smallr" VALUE="5">
<PARAM NAME="O" VALUE="70">
<PARAM NAME="redBits" VALUE="242">
<PARAM NAME="greenBits" VALUE="255">
<PARAM NAME="blueBits" VALUE="139">
<PARAM NAME="I" VALUE="400">
</APPLET>
<BR>

Created by <A HREF="http://wordsmith.org/anu/">Anu </A> <A HREF="http://wordsmith.org/anu/">Garg</A>. <P>


I have suggestions for improving this applet?

Your comments are welcome at gargATwordsmith.org.


Download

Compressed zip file with source, bytecode and all supporting files: spirograph.zip


Where can I buy the good old spirograph I can touch and hold?

If you'd rather have a spirograph made of atoms rather than bits, you can buy one at Amazon.com.


Awards

SUG's Java SIG: Cool Applet of the Week

Gamelan: What's Cool


Anu Garg