We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Lorenz attractor trouble
Page Index Toggle Pages: 1
Lorenz attractor trouble (Read 1344 times)
Lorenz attractor trouble
Jun 3rd, 2005, 10:42am
 
Hey guys, I was hoping some o you could help me with this stuff... I admit I'm no math wiz (at all), but I can't get this equation to render properly...

code:
void setup(){
 size(400,400);
 loop();
 background(255);
 stroke(0);
 strokeWeight(2);
}

float a=20.0, b=(8/3), c=10.0, d=0.0, T = 0.02;
float xP = random(-10, 10), yP = random(-10, 10), zP = random(-10, 10);
void draw(){
 translate(200,200);
 xP += ((a*d)*yP) - ((a*d)*xP);
 yP += (d*(b*xP)) - (d*yP) - (d*(zP*xP));
 zP += (d*(xP*yP)) - (d*(c*zP));
 d += T;
 point(xP,yP, zP);
}


I renders squat, except if I leave out zP in the point rendering... then all I get is a point in 0.0,0.0 exactly... I dunno if I screwd up the equation, or what the hell I did :)
Re: Lorenz attractor trouble
Reply #1 - Jun 3rd, 2005, 11:04am
 
change size(400,400); to size(400,400,P3D);

appeared some dots on my screen at least, without removing the zP..

-seltar
Re: Lorenz attractor trouble
Reply #2 - Jun 3rd, 2005, 12:42pm
 
oook 0.o

I got a few specs too.. I must've screwed up the equation somewhere, but at least now I get SOMEthing... Cheesy
Page Index Toggle Pages: 1