POV-Ray : Newsgroups : povray.binaries.images : Here's TIA Server Time: 29 Jan 2020 13:51:53 GMT
  Here's TIA (Message 1 to 3 of 3)  
From: Melody
Subject: Here's TIA
Date: 11 Jan 2020 02:50:01
Message: <web.5e193327d41def9da690110@news.povray.org>
Do you want to read a long winded thesis - or hear the lecture???
NO. you want to see 10 lines of code and grok it in 2 minutes.

There was color midpoint stuff that changed nothing for a smooth palette, but
all palette stuff aside, here is "Triangle Inequality"

Eleven significant lines ... TIA
int mandel(double px, double py) {
  int ra,col, mandelbrotPower = 2; ///double bailout = pow(10,3);
  double bailout_squared = bailout * bailout;
  double sum=0,sum2=0,ac,il,lp,az2,lowbound,f,index;
  double z[2] = { 0.0,0.0 } ;
  double c[2] = { px,py } ;
  double v[2] = { 0,0 } ;
  /// Triangle Inequality

  ac = VLEN2(c);
  il = 1.0 / log(mandelbrotPower);
  lp = log(log(bailout) / mandelbrotPower);

  int i = 0;
  double x = 0.0, y = 0.0, xx = 0.0, yy = 0.0;
  while ((i < MAX_iters) && (xx + yy < bailout_squared)) {

    if (ABORT) break;
    y = 2.0 * x * y + py;
    x = xx - yy + px;
    xx = x * x;
    yy = y * y;

    z[0] = x;
    z[1] = y;
    sum2=sum;
    if ((i) && (i != MAX_iters-1)) {
      SUBV2(v,z,c);
      az2 = VLEN2(v);
      lowbound = fabs(az2 - ac);
      sum+=((VLEN2(z)-lowbound)/(az2+ac-lowbound));
    }
    i++;
  }
  if (i == MAX_iters) col = 0;
  else {
    ///TIA log(log(length)) log(pwr) log(log(bailout/pwr))
    ///  figured in with last 2 sums- "Triangle"
    sum = sum / (float)i;
    sum2 = sum2/(float)(i-1);
    f = il*lp - il*log(log(VLEN2(z)));
    index = sum2 + ((sum-sum2) * (f+1.0));

/// rest is just palette stuff
    ra = (int)(index * 255.0);
    if (ra < 0) ra += 255;

ra = (ra + (int)(nColors * colorcycle) ) % nColors;
    col = colorpalette[ra];
  }
  return col;
}

fractal height fields? hmmm ...


Post a reply to this message


Attachments:
Download 'save000.jpg' (826 KB)

Preview of image 'save000.jpg'
save000.jpg


 

From: Melody
Subject: Re: Here's TIA
Date: 11 Jan 2020 10:30:01
Message: <web.5e19a3339fde3b919da690110@news.povray.org>
Finished the color spreader stuck at 45, now 3 to 100.
between 2 to 64 colors

That control factor, like contrast, pulls out detail,
where the colorcycle will put the like/dark where you want it.


Post a reply to this message


Attachments:
Download 'save000.jpg' (849 KB)

Preview of image 'save000.jpg'
save000.jpg


 

From: Melody
Subject: Re: Here's TIA
Date: 11 Jan 2020 11:15:01
Message: <web.5e19ade09fde3b919da690110@news.povray.org>
I'll need a better job, to get the machine I need, heh.
bailout is a million times a million, or 10^12.
"10^20 recommended" -- but I saw results at 10^3 that were posted.
Details!


Post a reply to this message


Attachments:
Download 'mandel.png' (314 KB)

Preview of image 'mandel.png'
mandel.png


 

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.