This post goes in conjunction with my latest design piece, ‘Maybe It’s A Sine’. The foundation for that piece was created using a script in Flash which generated a Lissajous curve. By definition, a Lissajous curve is the graph of the system of parametric equations which describes complex harmonic motion. Don’t be intimidated; the math is actually fairly simple.
// Where cx and cy are the coordinates for the center of the stage.
var x:Number = A * Math.sin(a * nTime + (Math.PI / 2)) + cx;
var y:Number = B * Math.sin(b * nTime) + cy;
Given those two formulas, all you need now is an enter frame or timer event to increment the time and usage of the Flash drawing API to actually draw the whole thing out. I tweaked the formulas quite a bit and experimented with different variations to see what would happen. Below are some of my favorite results.
It’s amazing what some simple math and code can create.8 comments