This is a formula I found initially through a program for the iPad called Frax...
They use a Line Average coloring algorithm... I googled it and found this.
I have no clue how to program it into UF, so I was hoping to find someone here that did know how...

float xmin = -2.5; 
float ymin = -2.0; 
float wh = 4;
float stripes = 5.0;
int maxIterations = 1000;

void setup() {
  size(800, 800, P2D);
}

void draw() {
  loadPixels();
  float xmax = xmin+wh;
  float ymax = ymin+wh;
  float dx = (xmax-xmin)/width;
  float dy = (ymax-ymin)/height;
  float x = xmin;
  for (int i = 0; i < width; i++) {
    float y = ymin;
    for (int j = 0;  j < height; j++) {
      float zr = x;
      float zi = y;
      float lastzr = x;
      float lastzi = y;
      float orbitCount = 0;
      int n = 0;
      while (n < maxIterations) {
        float zrr = zr*zr;
        float zii = zi*zi;
        float twori = 2*zr*zi;
        zr = zrr-zii+x;
        zi = twori+y;
        if (zrr+zii > 10000) break;
        orbitCount += 0.5+0.5*sin(stripes*atan2(zi, zr));
        lastzr = zr;
        lastzi = zi;
        n++;
      }
      if (n == maxIterations) pixels[i+j*width] = 0;
      else {
        float lastOrbit = 0.5+0.5*sin(stripes*atan2(lastzi, lastzr));
        float smallCount = orbitCount-lastOrbit;
        orbitCount /= n;
        smallCount /= n-1;
        float frac = -1+log(2.0*log(10000))/log(2)-log(0.5*log(lastzr*lastzr+lastzi*lastzi))/log(2);      
        float mix = frac*orbitCount+(1-frac)*smallCount;
        float orbitColor = mix*255;
        pixels[i+j*width] = color(orbitColor);
      }
      y += dy;
    }
    x += dx;
  }
  updatePixels();
  noLoop();
}
This is a formula I found initially through a program for the iPad called Frax... They use a Line Average coloring algorithm... I googled it and found this. I have no clue how to program it into UF, so I was hoping to find someone here that did know how... ```` float xmin = -2.5; float ymin = -2.0; float wh = 4; float stripes = 5.0; int maxIterations = 1000; void setup() { size(800, 800, P2D); } void draw() { loadPixels(); float xmax = xmin+wh; float ymax = ymin+wh; float dx = (xmax-xmin)/width; float dy = (ymax-ymin)/height; float x = xmin; for (int i = 0; i &lt; width; i++) { float y = ymin; for (int j = 0; j &lt; height; j++) { float zr = x; float zi = y; float lastzr = x; float lastzi = y; float orbitCount = 0; int n = 0; while (n &lt; maxIterations) { float zrr = zr*zr; float zii = zi*zi; float twori = 2*zr*zi; zr = zrr-zii+x; zi = twori+y; if (zrr+zii &gt; 10000) break; orbitCount += 0.5+0.5*sin(stripes*atan2(zi, zr)); lastzr = zr; lastzi = zi; n++; } if (n == maxIterations) pixels[i+j*width] = 0; else { float lastOrbit = 0.5+0.5*sin(stripes*atan2(lastzi, lastzr)); float smallCount = orbitCount-lastOrbit; orbitCount /= n; smallCount /= n-1; float frac = -1+log(2.0*log(10000))/log(2)-log(0.5*log(lastzr*lastzr+lastzi*lastzi))/log(2); float mix = frac*orbitCount+(1-frac)*smallCount; float orbitColor = mix*255; pixels[i+j*width] = color(orbitColor); } y += dy; } x += dx; } updatePixels(); noLoop(); } ````
 
0
reply

Try setting the Formula to Mandelbrot in standard.ufm and the Outside coloring to Stripes in jh.ucl, and set the Bailout values for both the formula and coloring to the same value (the code uses 10000). I didn't compare the code in detail, but it seems similar with a quick glance.

Try setting the Formula to Mandelbrot in standard.ufm and the Outside coloring to Stripes in jh.ucl, and set the Bailout values for both the formula and coloring to the same value (the code uses 10000). I didn&#039;t compare the code in detail, but it seems similar with a quick glance.
 
0
reply

Wow, that was it. Exactly what I was looking for! Thank you very much for the help!

Cheers,
Stephen

Wow, that was it. Exactly what I was looking for! Thank you very much for the help! Cheers, Stephen
 
0
reply
221
views
2
replies
3
followers
live preview
Enter at least 10 characters.
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft