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
hypotrochoid(sX, sY, rad, rad2, amt, incr, c2);
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
- rad — radius of a rolling circle.
- rad2 — radius of a fixed circle.
- 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.
- var posX = sX + ((rad2 – rad) * Math.cos(perd)) + (amt * Math.cos (((rad2 – rad)/rad) * perd));
- var posY = sY + ((rad2 – rad) * Math.sin(perd)) + (amt * Math.sin (((rad2 – rad)/rad) * perd));
- 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
epitrochoid(sX, sY, rad, rad2, amt, incr, c2);
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
- rad — radius of a rolling circle.
- rad2 — radius of a fixed circle.
- 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:
- var posX = sX + ((rad2 – rad) * Math.cos(perd)) + (amt * Math.cos (((rad2 – rad)/rad) * perd));
- var posY = sY + ((rad2 – rad) * Math.sin(perd)) + (amt * Math.sin (((rad2 – rad)/rad) * perd));
- c2 — stroke color.
rosemary
rosemary(sX, sY, rad, cons);
- sX — center of shape X position
- sY — center of shape Y position
- rad — radius of shape
- 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
updates/expansions
- Cassini Ovals [02/22]
- Rhodonea Curve [02/22]
- Rhodonea (Cosine Variation) [04/14]
- Rhodonea (Tangent Variation) [04/14]
- Astroid [02/22]
- Nephroid [04/13]
- Spiral of Archimedes [04/13]
- Fermat’s Spiral [04/14]
- Lituus [04/14]
- Epicycloid, Epitrochoid, Hypocycloid, Hypotrochoid [04/14]
- Cochleoid [04/15]