2.2 Spiral

A spiral is exactly the same as the circle but there's just one more option to set in the setoptions() function, the "SpiralValue". This determines how many pixels the radius will decrease for every angle incrementation. This script can be fun to play around with. You can begin with a very small radius and spiral outward from there. Or if you fool with the number of cycles it'll go past the center and begin spiraling outward.

```function spiral() {
SpirLayername = "layer1";  // name of the layer you want to move
SpirRadius = 160;          // radius of Circle in pixels
SpirVertical = 1.0;        // vertical multiplier, <1 makes thinner, >1 makes fatter
SpirHorizontal = 1.0;      // horizontal multiplier
SpirAnglestart = 0;        // starting angle (0 is the right edge of the cirrle, 90 is at the top and so on)
SpirAngleinc = 7;          // angle incremenation, a larger number makes it go faster
SpirCycles = 3.0;          // the number of times you want to go around (decimals allowed)
SpirDirection = 1;         // "1" is clockwise, "-1" is counter-clockwise
SpirSpeed = 30;            // repetition speed in milliseconds
SpiralValue = 1.0;         // the number of pixles to spiral inward (decimals allowed, use negative to move outward)
SpirAngle = SpirAnglestart;
SpirLeft = document.layers[SpirLayername].left - SpirHorizontal*SpirRadius*Math.cos(SpirAngle*Math.PI/180);
SpirTop = document.layers[SpirLayername].top + SpirVertical*SpirRadius*Math.sin(SpirAngle*Math.PI/180);
slidespiral();
}

function slidespiral() {
if (Math.abs(SpirAngle - SpirAnglestart) < SpirCycles*360) {
SpirAngle += SpirDirection*SpirAngleinc;