Gumowski-Mira attractor
in
Programming Questions
•
2 years ago
Hi, this is my first post on this forum and I don't know if there is a solution for my problem, also I'm new on Processing.
I worked on a code about Peter de joung attractor connecting this code to Grasshopper with an UDP receiver, you can see my code here:
Now I'm working to a code about the Gumowski-Mira attractor( see an actionscript here:
http://actionsnippet.com/?p=9089), but for now it doesn't work.
Is anybody know how I can write correctly my code?
Here the pseudo-code:
float a,b,xn1,yn1,xn,yn,G;
float s,iterations;
void setup()
{
size (800,800);
frameRate(30);
a=0.02;
b=0.9998;
xn1=5;
yn1=0;
s=10;
iterations=20000;
G= a * x + (2 * (((1 - a) * x2) / (1 + x2)));
}
void draw()
{
background(255);
fill(175,40);
a = mouseY / 1000;
xn1 = mouseX / 30;
yn1 = 0;
for (int i= 0; i<iterations; i++){
xn = xn1;
yn = yn1;
xn1 = b * yn + G(xn);
yn1 = -xn + G(xn1);
set (280 + xn1 * s, 300 + yn1 * s, 0x000000);
i++;
}
}
Thx so much,
D
--
1