4

image of the fractal

So I was experimenting with fractals and created this. The equations are

$$ A \leftarrow A^2 + x - B \\ B \leftarrow B^2 - y + A $$ and the set is defined as the points (x,y) on a graph which when the equations are iterated, $A$ AND $B$ remain bounded.

(The colours in the graph are from the number of iterations required to surpass the threshold of $-2$ for either $A$ or $B$.)

Initial values for $A$ and $B$ are 0

if you are wandering about computation, it is iterated 216 times and the threshold for being considered not bound is $A$ or $B$ being over 10,000,000,000.

  • 1
    Welcome to MSE. Please learn to use MathJax to type the math in your questions. – jjagmath Aug 25 '21 at 16:54
  • 1
    Does A = A^2 + x -1B it's supposed to mean $A= A^2+x-B$ or $A = A^2+(x-1)B$? – jjagmath Aug 25 '21 at 16:56
  • 1
    Also, since you are talking about iterations I'm guessing that you didn't mean an equation, but a recursion of the form $A_{n+1} = A_n^2 + (x-1) B_n$ and $B_{n+1} = B_n^2 + (y-1) B_n$. It's that the case? If yes, what are $A_0$ and $B_0$? What are $x$ and $y$? How did you determined if the iteration remained bounded? If you don't show any effort writing your questions, they will be poorly received in this forum. – jjagmath Aug 25 '21 at 17:03
  • @jjagmath Bidmas answers your first question. the initial values for A and B, i forgot to mention, are 0. and x and y are just the position (x,y) of the point in question. my apologies for lack of detail. I don't understand this notation for iteration, but, put in to words, values A, B, x and y are inputted into both functions which outputs a new value for A and B. x and y stay the same, and this is repeated forever, and points (x,y) which have bounded A and B values (which I calculated just by iterating a few 100 times and then displaying points with A and B values less that a 100000000000. – George Russell Aug 25 '21 at 17:19
  • 2
    @GeorgeRussell. $A_n$ and $B_n$ denotes the values of $A$ and $B$ at the $n$:th iteration. The next iteration will be the $(n+1)$:th iteration and the value of $A$ at that iteration will thus be denoted $A_{n+1}$. – md2perpe Aug 25 '21 at 17:52
  • thank you @md2perpe – George Russell Aug 25 '21 at 18:14
  • 2
    @GeorgeRussell Don't post all that information in a comment. Edit and improve your question. – jjagmath Aug 25 '21 at 18:20
  • @jjagmath all changes have been made – George Russell Aug 25 '21 at 18:38
  • @BarryCipra can you explain why you think it should be? – George Russell Aug 25 '21 at 22:16
  • @BarryCipra (0,0) is just north east of the center – George Russell Aug 26 '21 at 09:12
  • @BarryCipra I understand. I don't understand why it is not symmetrical either, but I dont think it can be caused by error, since all error would be symetrical also. it may just be that negative x and positive y is different to positive x and negative y. – George Russell Aug 26 '21 at 12:36
  • you are right @BarryCipra ! I had the $y$ and $A$ swapped! this fractals correct formula is $$ A \leftarrow A^2 + x - B \ B \leftarrow B^2 - y + A $$ I think what confuses things more is I also had the image flipped about the y axis – George Russell Aug 26 '21 at 20:56
  • @BarryCipra I have updated the question with the right formula – George Russell Aug 26 '21 at 21:09
  • @GeorgeRussell, great, thank you! FWIW, I think I liked the look of the first version better, though maybe I'd say the opposite if the current picture had come first. In any event, I still find it striking and intriguing. You might consider submitting it to a Bridges art exhibit. – Barry Cipra Aug 26 '21 at 22:09
  • Generally speaking, questions like "have I discovered something new?" and "what is this thing called?" are not really on-topic here (the latter might be on-topic if you can present a reason for believing that a particular object is well-studied enough to have been named by someone). Broadly speaking, the object you have described is the attractor or invariant set of a non-linear iterated function system which acts on $\mathbb{R}^2$. I see no reason to believe that this particular IFS has been studied or named in the past. – Xander Henderson Aug 28 '21 at 17:14
  • 1
    @GeorgeRussell, you might be able to get your question reopened if you change it to ask if there is a better way to tell when $(A,B)$ is escaping to infinity than the threshold criterion your computation uses. (Full disclosure: I have a reasonably good answer to that question, which I was writing up when the question was closed.) – Barry Cipra Aug 29 '21 at 11:28

1 Answers1

2

Not an answer but too long for a comment.

I reproduced the image with this code for shader editor app from fdroid for Android:

#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif

uniform vec2 resolution;

void main(void) { float R = 8.0; vec2 uv = R * (gl_FragCoord.xy / resolution.xy - vec2(0.5)) * resolution.xy/resolution.y; vec4 x = vec4(uv.x) + vec4(0,0,1,1) / resolution.y * R; vec4 y = vec4(uv.y) + vec4(0,1,0,1) / resolution.y * R; vec4 A = vec4(0.0); vec4 B = vec4(0.0); vec4 m = vec4(0.0); bool escaped = false; for (int i = 0; i < 256; ++i) { vec4 A1 = AA + x - B; vec4 B1 = BB + y + A; A = A1; B = B1; if ((AA+BB).x > 1.0e6) { m = vec4(i) - log2(log2(AA+BB)); escaped = true; break; } } m = floor(m); bool axis = abs(x.x) < 0.1 || abs(y.x) < 0.1; x = floor(x); y = floor(y); bool e = m.x == m.y && m.y == m.z && m.z == m.w; bool grid = x.x == x.w && y.x == y.w; gl_FragColor = vec4( (grid ? vec3(1) : vec3(axis ? 0.0 : 0.8)) * (escaped ? vec3(e) : vec3(0.8)) , 1.0); }

fractal

The grid spacing is 1, centered on the origin. Note the signs in the formula: $$ A_{n+1} = A_n^2 + x - B_n \\ B_{n+1} = B_n^2 + y + A_n $$

Claude
  • 5,647
  • very good effort here, thank you @Claude. although I noticed in the rings external, there aren't those spikes like in my render. – George Russell Aug 26 '21 at 09:15
  • 1
    Could you add some add a non-programmic description of your code, for the benefit of those of us who can't read the code? In particular, I can't figure out what range of values you're using for $x$ and $y$. Please see my (long) comment below the OP regarding the asymmetry of the picutre you've reproduced. I don't see how the picture can fail to be symmetric across the line $y=x$. The only $x$-$y$ asymmetry I see in your code is that you use resolution.y in defining both vec4 x and vec4 y (whatever "resolution.y" means). – Barry Cipra Aug 26 '21 at 11:42
  • @BarryCipra The signs are different in the two equations in this version, causing the asymmetry. The OP must have made a mistake in transcribing the equations. – Jaap Scherphuis Aug 26 '21 at 13:45
  • @JaapScherphuis, ah, thanks! That would certainly explain things. I didn't notice Claude's signs. I had assumed he used the OP's equations. – Barry Cipra Aug 26 '21 at 16:29
  • @JaapScherphuis, just so you know, the OP agreed they'd misreported the equation. It turns out they really meant to compute with the formula $B^2-y+A$, so their now-corrected version is mirror opposite to yours (because of the $-y$). – Barry Cipra Aug 26 '21 at 22:11
  • Oops, I meant to say opposite to Claude's (not Jaap's). – Barry Cipra Aug 26 '21 at 23:24