Spirograph

The applet.

What is a Spirograph?

How to use this applet?

How to put this applet on your homepage?

Do you have any suggestions for improving this applet?

Source.

SUG's Java SIG: Cool Applet of the Week


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

What is a Spirograph?

A Spirograph is 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 this applet?

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 you have to do and you'll have Spirographs on your homepage!

<APPLET CODEBASE="http://www.wordsmith.org/~anu/java/" CODE="Spiro.class" width=500 height=300>
<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>


Anu Garg