strange symmetry

Another old piece I spent a few extra hours on. Hun­dreds of par­ti­cles with ran­dom start­ing posi­tions are iter­ated, their coor­di­nates (x,y) trans­formed by mun­dane math­e­mat­ics. My home­baked expres­sions, sev­eral poten­tially chaotic attrac­tors man­gled together, look com­plex but are actu­ally more weird than dif­fi­cult — a bit like the expres­sions on the black­board in a Gary Lar­son cartoon:

x right p_0 (sin(p_1 y) + p_2 cos(p_1 x))+(1-p_0)(y + p_3 x/delim{|}{x}{|} sqrt{delim{|}{p_4 x - p_5}{|}} )
y right p_0 (sin(p_6 x) + p_7 cos(p_6 y))+(1-p_0)(p_8-x)

The code ran­domly gen­er­ates the para­me­ters p1 to p8 (between –2 and 2) and p0 (between 0 and 1). Most results are not very spe­cial but an occa­sional gem shows up. There are ways of auto­mat­i­cally elim­i­nat­ing many of the less inter­est­ing cases. These not only take time but inevitably remove some nice con­structs. So I left out any pre­s­e­lec­tion. Think of it as search­ing the beach for a rare shell…

Feel free to explore the 9 para­me­ter uni­verse with this online ver­sion. It is very unlikely that the pic­ture that’s form­ing on your screen will ever be gen­er­ated exactly the same on any other machine. Since every plot is unique it’s hard to get the cor­rect scale and posi­tion, so you’ll have to do it your­self. Zoom in and out with ‘+’ and ‘-’. Move the con­struct with the arrow keys. The move­ment is a bit chunky because the image has to redraw every time the con­struct moves. Press­ing ‘c’ cycles through sev­eral color palettes using the par­ti­cle den­sity, veloc­ity and accel­er­a­tion in dif­fer­ent ways. Most impor­tantly, press­ing space saves the image to the user gallery. Noth­ing will appear to hap­pen for a while but give it some time to fin­ish. Since I inten­tion­ally neglected to pro­vide a way of stor­ing the 9 para­me­ters, you can never recover a lost image which hasn’t been saved. The choice is yours, share the image and lose its unique­ness or keep it to your­self and lose it for­ever… Oh, any other key ran­domly gen­er­ates a new construct.

Update : I’ve improved the inter­face a bit. Zoom­ing now prop­erly respects the cen­ter­ing. You can also move the con­struct by click­ing and drag­ging the mouse. Press­ing ‘r’ will cen­ter the image on the cur­rent mouse position.

strangesymmetry_20080327-194514 strangesymmetry_20080327-162456 strangesymmetry_20080327-185321 strangesymmetry_20080327-154708 strangesymmetry_20080327-181949

4 Responses to “strange symmetry”

  1. rce12 says:

    Wow, in the past is mono­chrome. The now is col­or­ful. :)

  2. Lorenzo says:

    Wow…very nice applet…I’ll spend some hours on study­ing the code! so glad that some­one is still shar­ing his work.…:D

  3. davbol says:

    very nice! and your “weird” for­mula is inter­est­ing :)

    would it be pre­sump­tious to offer an idea? not a cri­tique, take it fwiw…

    i see that you’re con­vert­ing your accu­mu­la­tion buffer non­lin­early with sqrt() and that works sweet, but still seems to over­sat­u­rate if you run it long enough — so i’m won­der­ing if the response might be log­a­rith­mic?, so if you were to scale by log(value)/log(maxvalue) you might be able to run long enough to fill in the “veil” areas of low accu­mu­la­tion before the basins over­sat­u­rate? just a thought

    love the rest of your works too, cheers!

  4. admin says:

    rce12: thanks, glad to see you know the old ver­sion.
    lorenzo: ummm, so peo­ple actu­ally look at the code… I guess I’ll need to start doc­u­ment­ing then. In the mean­time, if you have any ques­tions just mail me directly.
    davbol: thanks Dave, it’s great to get com­ments from peo­ple whose work I admire. You’re right that there’s still a ten­dency for sat­u­rat­ing the par­ti­cle den­sity. As can be seen in cer­tain color palettes, the veloc­ity accu­mu­la­tion grid behaves bet­ter and gives less bloom. I’m still work­ing on bet­ter ren­der­ing and log() is indeed a good choice. How­ever, for the moment it requires too much user inter­ac­tion for a web based applet. For some struc­tures it works, for oth­ers it doesn’t. The sqrt() is a good com­pro­mise as it gives good results for a wide range of val­ues. To be continued…

Leave a Reply