# Generative Sigils

Related articles: TAD2011.06 Lorenz Attractor | Processing + EPOC via OSC

In his book, Chaos in Wonderland: Visual Adventures in a Fractal World, Clifford Pickover describes methods for generating beautiful, complex images from certain chaotic equations. In the context of the book’s narrative, these images are the dreams of a species of inorganic, computer-like entities called the Latööcarfians — the “dream-weavers of Ganymede.” Here I consider using these images as algorithmically generated magical sigils (cf., generative art).

The images are generated by recursively plotting:

xt + 1 = sin(ytb) + c sin(xtb)
yt + 1 = sin(xta) + d sin(yta)

(There are variant equations that produce “mutations” — see “Appendix A: Mutations of Equations”, pp. 209–210.) Here is a sketch that will draw the following image in Processing:

```/** Generative Sigil 1
* Based on code on pg. 26 of _Chaos in Wonderland_
* by Clifford A. Pickover
* Good ranges for a, b, c, and d:
* (-3 < a, b < 3)
* (0.5 < c, d < 1.5)
*/

float a = 1.5641136;
float b = 2.7102947;
float c = 0.9680385;
float d = 0.995141;
float x, y = 0.1;
int counter = 0;
int iterations = 500000;

void setup() {
size(700,700,P2D); // remove P2D for Processing v2.0
background(0); // black
stroke(255,255,255,90); // white, semi-transparent
}

void draw() {
println(counter);
translate(width/2, height/2); // draw from center of window
float xNew = sin(y*b) + c * (sin(x*b));
float yNew = sin(x*a) + d * (sin(y*a));
x = xNew; y = yNew;
point(x*100, y*100);
counter++;
if(counter >= iterations) {
println("done!");
noLoop();
}
}
``` I hypothesize that the key to using such images successfully as magical sigils is to assign non-trivial values to the inputs, a, b, c, and d. E.g., one could randomly generate the values at an auspicious moment, or acquire values from some act or object, and map those to the optimal ranges for the algorithm’s inputs. The magician could wear the Emotiv EPOC during a magical ritual and at the ritual’s apex a Processing sketch could map data from the EPOC to the a, b, c, and d values for generating the image. The images could subsequently be used for divination or evocation.

N.b., even while keeping the input values within optimal ranges, not all sets of values produce interesting images. Here is a Processing function to calculate the set’s Lyapunov exponent (based on the code on p. 62 of Chaos in Wonderland) — values >= 0.5 tend to be more interesting:

```float calcLyapunovExponent(float a, float b, float c, float d) {
float Lsum = 0;
float n = 0;
float x = 0.1;
float y = 0.1;
float  xe = x + 0.000001;
float ye = y;
float xx, yy, xsave, ysave, dLx, dLy, dL2, df, rs, L = 0;
float bigNumber = 2139095039; /* Pickover's algorithm calls
for a long int (1000000000000) here, but I often get NaN returned
when using it in Processing, and I have found that using a
large float returns a value close enough to Pickover's to
be useful. */

for(int i=0; i<10000000; i++) {
xx = sin(y*b) + c*sin(x*b); yy = sin(x*a) + d*sin(y*a);
xsave = xx; ysave = yy; x = xe; y = ye; n++;
xx = sin(y*b) + c*sin(x*b); yy = sin(x*a) + d*sin(y*a);
dLx = xx - xsave; dLy = yy - ysave; dL2 = dLx*dLx + dLy*dLy;
df = bigNumber*dL2; rs = 1/sqrt(df);
xe = xsave + rs*(xx - xsave); ye = ysave + rs*(yy - ysave);
xx = xsave; yy = ysave; Lsum = Lsum + log(df); L = 0.721347*Lsum/n;
x = xx; y = yy;
}
return L;
}
```