# complex spirals and curves

## l-curves

lissajous(sX, sY, w, h, xm, ym, c2);

• Parametric equations of a lissajous curve is:
• var posX = sX + w*Math.cos(i*(Math.PI/180)*xm);
• var posY = sY + h*Math.sin(i*(Math.PI/180)*ym);
• Where i is a number that increments from 0 to 360.
• sX — center of shape, X position
• sY — center of shape, Y position
• w — width of the shape
• h — height of the shape
• xm — offset affecting x position, numerator of a frequency ratio of a sinusoidal movement
• ym — offset affecting y position, denominator of a frequency ratio of a sinusoidal movement
• cons — constant
• c2 — stroke color

## hypotrochoids

Shape of hypotrochoids dependent on the rad, rad2, amt, and incr values. Example images were generated by randomizing these values.

• sX — center of shape, X position
• sY — center of shape, Y position
• amt — constant representing 1) the amount of lines drawn, and 2) the distance of a point to the center of the rolling circle. These two variables have been arbitrarily linked. These qualities could be unlinked to allow for more randomization.
• incr — increment value related to change in position. Within the function, the period/perd (change in position) starts at zero radians and increases by incr amount until a certain number of lines are drawn.The following parametric equations are for the x, y coordinates of points on a path is wrapped in a for loop that iterates amt amount of times.
• c2 — stroke color.

Technically, this roulette is not a hypotrochoid. The correct parametric hypotrochoid formula for posY is sY + ((rad2 – rad) * Math.sin(perd)) – (amt * Math.sin (((rad2 – rad)/rad) * perd)).

## epitrochoids

Shape of epitrochoids dependent on the rad, rad2, amt, and incr values. Example images were generated by randomizing these values.

• sX — center of shape; X position
• sY — center of shape; Y position
• amt— constant representing 1) the amount of lines drawn, and 2) the distance of a point to the center of the rolling circle. These two variables have been arbitrarily linked. These qualities could be unlinked to allow for more randomization.
• incr — increment value related to change in position. Within the function, the period/perd (change in position) starts at zero radians and increases by incr amount until a certain number of lines are drawn.The following parametric equations are for the x, y coordinates of points on a path is wrapped in a for loop that iterates amt amount of times:
• c2 — stroke color.

## rosemary

• sX — center of shape X position
• sY — center of shape Y position
• cons — constant
• Parametric equations of a rose is:
• var posX = sX + rad * Math.sin(cons * i) * Math.cos(i);
• var posY = sY + rad * Math.sin(cons * i) * Math.sin(i);
• Where i is a number that increments from 0 to 360, and the cons is the constant number.
• Rosemary takes the four trigonometric portions of these equations, that is, Math.sin(cons * i) and Math.cos(i) from posX and Math.sin(cons * i) and Math.sin(i) from posY and randomizes the trigonometric functions within these segments between Math.sin, Math.cos, Math.tan, and Math.atan.
• c2 — stroke color