This is a simulation of a varioation of Chaos Equation,
mathametically represented as combnation of sine and cosine
functions. The values of variables varies according to perlin noise
algoritm with respect to time..
Please wait for a while until the animation loads.
Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
Please wait for a while until the animation loads.
CC Attribution NonCommercial ShareAlike
Chaos Equation
Tanna
xxxxxxxxxx
//Generative Art Workshop 2023
//Based on DeJong Equation and Perlin Noise
let a = 0;
let b = 0;
let c = 0;
let d = 0;
let startA, startB, startC, startD;
let endA, endB, endC, endD;
let t = 0;
let tIncrement = 0.005;
function setup() {
createCanvas(500, 500);
}
function draw() {
background(0);
// Align canvas in center of screen
translate(width/2, height/2);
// Use Perlin noise to smoothly transition between sets of values
if (t >= 1) {
startA = endA;
startB = endB;
startC = endC;
startD = endD;
do {
endA = random(-6, 6);
} while ((endA > -1.01 && endA < 1.01) || (endA > -0.4 && endA < 0.4));
do {
endB = random(-6, 6);
} while ((endB > -1.01 && endB < 1.01) || (endB > -0.4 && endB < 0.4));
do {
endC = random(-6, 6);
} while ((endC > -1.01 && endC < 1.01) || (endC > -0.4 && endC < 0.4));
do {
endD = random(-6, 6);
} while ((endD > -1.01 && endD < 1.01) || (endD > -0.4 && endD < 0.4));
t = 0;
}
a = lerp(startA, endA, t);
b = lerp(startB, endB, t);
c = lerp(startC, endC, t);
d = lerp(startD, endD, t);
noFill();
stroke(255, 50);
strokeWeight(1.25);
let negR = -6;
let posR = 6;
let x0 = random(negR, posR);
let y0 = random(negR, posR);
deJong(a, b, c, d, x0, y0, 25000);
t += tIncrement;
}
function deJong(a, b, c, d, x0, y0, iterations) {
let x = x0;
let y = y0;
for (let i = 0; i < iterations; i++) {
let nx = sin(a * y) - cos(b * x);
let ny = sin(c * x) - cos(d * y);
x = nx;
y = ny;
point(map(x, -3, 3, -width/2, width/2), map(y, -3, 3, -height/2, height/2));
}
}
function keyPressed() {
if (key === "s" || key === "S") {
save("deJong_a" + a.toFixed(2) + "_b" + b.toFixed(2) + "_c" + c.toFixed(2) + "_d" + d.toFixed(2) + ".png");
}
}
See More Shortcuts
Please verify your email to comment
Verify Email