Heres my attempt, leave it running and go have a coffee or something
code:
_root.createEmptyMovieClip("lor",1);
var scaler = 10;
function lorenz(h, a, b, c, x0, y0, z0, N, rad){
i=0;
lor.clear();
_root.onEnterFrame = function(){
x0 = x0 + h * a * (y0 - x0);
y0 = y0 + h * (x0 * (b - z0) - y0);
z0 = z0 + h * (x0 * y0 - c * z0);
if (i == 750){
lor.moveTo((x0 * scaler) + (z0 * scaler),(y0 * scaler) + (z0 * scaler))
}
if (i > 750){
R = (255*(i/N)).toString(16);
G = "00";
B = (255*(i/N)).toString(16);
col = "0x" + R + G + B;
trace((i/N) + " / " + col);
lor.lineStyle(0,col,100);
lor.lineTo((x0 * scaler) + (z0 * scaler),(y0 * scaler) + (z0 * scaler));
}
if (i++ == N) {
delete this.onEnterFrame;
}
}
}
lorenz(0.001099, 10, 28, 8/3, 1, 1, 1, 20000, 0.04);





Reply With Quote