Linear geometric transformations using IFS fractals

I am one of the developers of Perceptron http://perceptron.sourceforge.net - a unique generator of video feedback fractals written in Java. I would like to draw your attention to this open source project so that you can also participate in the forum on the SourceForge website.

In particular, I am interested in improving the current linear geometric transformations.

What the Perceptron generates is always an IFS fractal made from fragments of the Julia fractal. Such a combination is created in a two-stage cyclic (recursive, infinite) image conversion process:

morphing by z_new = f (z_old) + constant_c and linear mapping.

In the DoubleBuffer.java file, we read the color of the pixel from the "screen" in the coordinates specified in z_new = (x, y).

Naturally, the complex number z_new can be anywhere in the complex plane, but the “screen” has strict physical dimensions. The desired coordinates were scaled accordingly on the screen - this is not a problem.

However, we apply seemingly unnecessary rules, such as "accept the absolute value of z_new" or "if z_new is large, wrap it!". We apply these rules to prevent non-existent pixels from being read off-screen. Instead, we reread some pixels. This leads to amazing IFS fractals.

I want to know where I can find out more similar “linear geometric transformations” that interestingly complete arrays (matrices), create tiles, rotate, form data in matrices, giving them edges of various shapes, transformations that simulate mirrors, etc.

To illustrate this, see this code.

public int interface_getColor(int x, int y) { /** * Only positive x and y at the screen can be read to obtain * the color. */ x ^= x >> 31; // absolute values only; no choice but to disregard negative z_new y ^= y >> 31; x >>= 8; //divide by 256 y >>= 8; /** * The reflection transformation to put the off-screen z_new * points back within the screen. Although x = x % W and y = * y % H would suffice, it is more interesting like this... */ x = (x / W & 1) == 0 ? x % W : W_ONE - x % W; // if x/W is even then x =... else x=... y = (y / H & 1) == 0 ? y % H : H_ONE - y % H; /** * Since the screen is a one-dimensional array of length * W*H, the index of any element is i(x,y) = x + W * y. */ return buffer.getElem(x + W * y); } 

As you can see, bitwise operators are required for speed, and the classic packing of arrays gives more surprise than anyone ever hoped to see from the IFS fractal. It would be nice to replace this hard-coded block with equations from the definition file, and a template proposal is required.

+4
source share

Source: https://habr.com/ru/post/1447587/


All Articles