/* GENERATOR FOR HENON'S STRANGE ATTRACTOR A PC executable of this program can be downloaded by right-clicking henon.exe and then saving it to your local disk. October 1997 Robert John Morton */ #include #include #include #define XBIAS 320 #define YBIAS 240 main() { int c; float x = 0, y = 0, z, w; _setvideomode(_VRES16COLOR); _setcolor(7); _settextposition( 1, 27); printf("HERON'S STRANGE ATTRACTOR"); _settextposition(29, 30); printf("Hit C/R key to halt"); while(!kbhit()) { z = x; w = x * x; x = 1.4 * w; x = x + y - 1; y = .3 * z; _setpixel(XBIAS + (int)(x * 200), YBIAS - (int)(y * 200)); } c = getchar(); _settextposition(29, 30); printf("Hit C/R key to quit"); c = getchar(); _setvideomode(_DEFAULTMODE); } /* Author: Robert John Morton October 1997 */