I'm learning about strange attractors and the book I'm reading has QBasic examples of graphing 2D functions. I'm trying to convert one of the examples to Processing, but I keep stumbling over myself. Maybe I am missing boundary checks?
Any help would be greatly appreciated!
Thanks.
/// int prev = 5; int nmax = 11000; int omax = 2; int d = 2; float xmin; float xmax; float ymin; float ymax; float xp, yp;
if(n > 100 && l < .005) { println("2nd"); setparm(); } if((abs(x2-x) + abs(y2-y)) < .000001) { println("3rd"); setparm(); } x = x2; y = y2; } } /* 2400 REM Test results 2410 IF ABS(XNEW) + ABS(YNEW) > 1000000! THEN T% = 2 'Unbounded 2430 GOSUB 2900 'Calculate Lyapunov exponent 2460 IF N >= NMAX THEN T% = 2 'Strange attractor found 2470 IF ABS(XNEW - X) + ABS(YNEW - Y) < .000001 THEN T% = 2 2480 IF N > 100 AND L < .005 THEN T% = 2 'Limit cycle 2490 Q$ = INKEY$: IF LEN(Q$) THEN GOSUB 3600 'Respond to user command 2500 IF MENU(0) = 2 AND MENU(1) = 1 THEN Q$ = "S": GOSUB 3600 2510 X = XNEW 'Update value of X 2520 Y = YNEW 2550 RETURN */