Monday, February 09, 2009

Spirograph by Anu Garg

Here is something to keep you amused...play with the sliders for different effects on the spirograph.

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 equations of the resulting curve is defined by:
x = (R+r)*cos(t) - O*cos(((R+r)/r)*t)y = (R+r)*sin(t) - O*sin(((R+r)/r)*t)(moving circle outside the fixed circle)
x = (R-r)*cos(t) + O*cos(((R-r)/r)*t)y = (R-r)*sin(t) - O*sin(((R-r)/r)*t)(moving circle inside the fixed circle)

http://wordsmith.org/anu/java/spirograph.html









No comments: