Yesterday in the late evening I had an idea to make it possible to not only color and detect cycles of any length, but also cycles that might overlap or are interrupted by chaos. I'm quite proud to anounce that it works! Below is the code. It is set that it searches for a seed with exactly two cycles (chaos is not counted) and shows you a dirty preview. After that it renders the map. This is far from a user friendly programm but it shows how and that it works. The function I created can also be used to detect cycles in a seed, the length of them and one of the points in them. This might be interesting for future experiments!

`float a, b, c, d, x, y, xp, yp, xs, ys, temp;`

PFont f;

int t = 0, temp2;

float orbp[][] = new float[50][3]; //x, y, cycle length

int maxorb = 0;

void setup() {

size(400, 400);

f = createFont("Arial", 16, true);

background(0);

while (maxorb != 2) {

a = random(-4, 4);

b = random(-4, 4);

c = random(-4, 4);

d = random(-4, 4);

checkorbits(0.00001);

}

delay(500);

println(maxorb);

for (int i = 0; i < maxorb; i++) {

println(orbp[i][0] + " " + orbp[i][1] + " " + orbp[i][2]);

}

println("a = " + a + "; b = " + b + "; c = " + c + "; d = " + d + ";");

delay(500);

}

void draw() {

if (t < 200) {

background(0);

for (int j = 0; j < 10; j++) {

xp = random(-2, 2);

yp = random(-2, 2);

for (int i = 0; i < 500; i++) {

x = sin(yp * b) + c * sin(xp * b);

y = sin(xp * a) + d * sin(yp * a);

if (i > 480) {stroke(255); line(map(x, -5, 5, 0, width), map(y, -5, 5, height, 0), map(xp, -5, 5, 0, width), map(yp, -5, 5, height, 0)); noStroke(); fill(255, 0, 0); ellipse(map(x, -5, 5, 0, width), map(y, -5, 5, height, 0), 2, 2);}

if (i > 400) {noStroke(); fill(255, 0, 0); ellipse(map(x, -5, 5, 0, width), map(y, -5, 5, height, 0), 2, 2);}

xp = x;

yp = y;

}

}

}

if (t > 200) {

for (int px = 0; px < width; px += 1) {

for (int py = 0; py < height; py += 1) {

xp = map(px, 0, width, -5, 5);

yp = map(py, 0, height, -5, 5);

temp2 = -1;

for (int i = 0; i < 500; i++) {

x = sin(yp * b) + c * sin(xp * b);

y = sin(xp * a) + d * sin(yp * a);

for (int k = 0; k < maxorb; k++) {if (abs(x - orbp[k][0]) < 0.00001 && abs(y - orbp[k][1]) < 0.00001) {temp2 = k; break;}}

xp = x;

yp = y;

}

if (temp2 == 0) {set(px, height - py, color(255));} //0, 255, 45

if (temp2 == 1) {set(px, height - py, color(0));}//255, 153, 0

if (temp2 == 2) {set(px, height - py, color(0, 128, 255));}

if (temp2 == 3) {set(px, height - py, color(191, 0, 255));}

if (temp2 > 3) {set(px, height - py, color(255, 255, 255));}

}

if (px%10 == 0) {println(nf(px, 4));}

}

}

t++;

//println(t);

if (t == 200) {background(100);}

}

void checkorbits(float delta) {

boolean tempa;

boolean tempb;

float xc = 0, yc = 0;

int cycl = 0;

maxorb = 0;

for (int j = 0; j < 50; j++) {

tempa = true;

tempb = true;

cycl = 0;

xp = random(-4, 4); yp = random(-4, 4);

for (int i = 0; i < 550; i++) {

x = sin(yp * b) + c * sin(xp * b); y = sin(xp * a) + d * sin(yp * a);

xp = x; yp = y;

if (i == 500) {xc = x; yc = y;}

if (i > 500) {

if (abs(x - xc) < delta && abs(y - yc) < delta && tempa) {cycl = i - 500; tempa = false;}

for (int k = 0; k < maxorb; k++) {if (abs(x - orbp[k][0]) < delta && abs(y - orbp[k][1]) < delta) {tempb = false; break;}}

}

}

if (tempb && cycl > 0 && cycl < 20) {orbp[maxorb][0] = x; orbp[maxorb][1] = y; orbp[maxorb][2] = cycl; maxorb += 1;} //cycl is lenght of cycle

if (maxorb >= orbp.length) {break;}

println(j);

}

}

Using that same function I also made some plots that show the number of cycles with a length < 20 in an [a x b]-map. The parameters c and d are shown in the name of the picture.

Black is 0, Green is 1, Orange is 2, Blue is 3, Violet is 4, and White is >4. They look ugly and are small, but that can be easily fixed by an adequate coloring scheme and by choosing bigger size.