home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!gatech!destroyer!cs.ubc.ca!alberta!fletcher
- From: fletcher@cs.UAlberta.CA (Cocquyt Fletcher B)
- Subject: Symmetric Chaos
- Message-ID: <fletcher.725667758@manning>
- Keywords: Chaos symmetric
- Sender: news@cs.UAlberta.CA (News Administrator)
- Nntp-Posting-Host: manning.cs.ualberta.ca
- Organization: University of Alberta, Edmonton, Canada
- Date: Tue, 29 Dec 1992 22:22:38 GMT
- Lines: 55
-
- In the December Scientific American they have an article "Christmas in the
- House of Chaos" by Ian Stewart pp 144-146. They give some formulae
- to generate images of symmetric chaos but they neglect to explain
- how to localize the patterns to the resolution of a standard monitor...
-
- I've tried to implement it using x modulo WIDTH and y modulo HEIGHT
- but I don't get the desired results...here is my algorithm right now:
-
- #define A 1.89 /* you can experiment with these constants */
- #define B -1.10
- #define C 0.17
- #define D -0.79
-
-
- for( loop = 0; loop < somebignumber; loop++ )
- {
-
- x=(((int)(A*x+B*x*(x*x+y*y)+C*(x*x*x-3*x*y*y)+D*(x*x-y*y))));
- y=(((int)(A*y+B*y*(x*x+y*y)+C*(3*x*x*y-y*y*y)-2*D*x*y)));
- /*
- x=(((int)(A*x+B*x*(x*x+y*y)+C*(x*x*x*x-6*x*x*y*y+y*y*y*y)+D*(x*x*x-3*x*y*y)))%WIDTH);
- y=(((int)(A*x+B*x*(x*x+y*y)+C*(4*x*x*x*y-4*x*y*y*y)+D*(-3*x*x*y+y*y*y)))%NTSC_HEIGHT);
-
- x=abs(x);
- y=abs(y);*/
- printf("%d %d\n",x,y);
- /*
- (*(cmap+WIDTH*y+x))++;
- SetAPen( &my_rast_port, ((int)((*(cmap+WIDTH*y+x))/11))%31);
- WritePixel(&my_rast_port,x,y);*/
- }
-
-
- The cmap just keeps track of how many times each point is "hit" by the
- formulae...The colors then reveal a "frequency map" of the
- relative attractiveness of each point (Their pictures look nice!)
-
- The commented out formulae are the ones for "three fold symmetry"
- and the others are for 4 fold. In each case I get only 40 to 109
- points plotted over and over again...I was expecting more
- diversity...
-
- Perhaps it is a problem with the way I take the mod and "disturb
- the mapping"? Anyone have any idea how to implement this?
-
- BTW my WIDTH was 352 pixels and NTSC_HEIGHT was 262...32 colors.
-
- The division by 11 in the SetAPen line was to slow down the
- rate the colors changed...
-
- Any suggestions/comments are welcome!
-
- -Fletch
-
-
-