You need an browser that can view Java applets, such as Netscape or Internet Explorer. If you are using such a browser, please enable Java and reload this page.

Swirl-n-Twirl will allow you to make circular patterns in various colors. This is similar to the drawing toys where you take a pen and have a disc spinning around to make repeated swirls to form a spiral pattern.

Instructions

Choose a background color and drawing color.
Set the width and height. Make them equal for a circular pattern.
Ink means the amount allowed to draw. The higher the value the more drawing there will be.
Size means the amount drawn between the angles.

Once you set up the parameters you can press Draw Lines or Draw Fill. Draw lines will draw in a line pattern as if drawn by a pen. Draw Fill will take the line pattern and try and make it solid looking.

If Size is greater than Ink it will not display.

Details behind the program

For those of you who are wondering how the program draws the patterns I'll explain the mathematics of it. It may help you make special patterns.

The program is drawing a polygon shape. It picks the points on the screen by going from 0 radians to the number of radians defined in Ink. Size tells it how many radians to skip between points.
It chooses the point as:
x+(width/2)*Math.cos(radian),y+(height/2)*Math.sin(radian)
Where x & y are the center of the polygon.
width & height are the size of the polygon.
radian is the radian worked on.

Lines just connects the dots of the polygon. Fill takes any of the lines that criss-cross in the polygon and fills them in.

Special Examples:

Ink=5 Size=2 Draw Fill makes a triangle.
Ink=100 Size=33 Draw Fill makes a square.
Ink=1200 Size=25 Draw Lines/Fill makes a circle.

Visited times.

Comments

Return to my Java Page