Mandelbrot ... but with no main cardioid!

  • 1 Replies
  • 221 Views

0 Members and 1 Guest are viewing this topic.

Offline quadralienne

  • *
  • Fractal Friend
  • **
  • Posts: 17
  • infinite border, finite area
« on: June 20, 2019, 09:34:19 PM »
Once upon a time I stumbled across

https://commons.wikimedia.org/wiki/File:Parameter_plane_and_Mandelbrot_set_for_f(z)_%3D_z%5E4_%2B_m*z.png

and I worked through the C code (languages without native complex numbers make me sad) to convert it to a MathMap expression:

unit filter JustCircles ()

  Mmax = 4096;
  Escape = 3;
  Escape2 = Escape * Escape;

  if r < 1.0 || abs(ri:[x-4/3,y]) < 1/3 || abs(ri:[x+4/3*cos(pi/3),abs(y)-4/3*sin(pi/3)]) < 1/3 then
    rgba:[0,0,0,1]
  else
    Mc = ri:[x,y];

    ang = atan(-y,-x)/3.0;
    rad = (0.0625 * (y*y+x*x)) ^ (1/6);

    Mz = ri:[rad * cos(ang), rad * sin(ang)];

    Mcount = 0;

    while ((Mz[0]*Mz[0]+Mz[1]*Mz[1]) < Escape2) && (Mcount < Mmax) do
      Mcount = Mcount + 1;
      Mz = Mz ^ 4 + Mz * Mc;
    end;

    if Mcount < Mmax then
      dist = log( Mcount + 1 - (log(log(abs(Mz)))/log(Escape)) ) / log(Mmax);

      hue = pmod(arg(Mz)/(2*pi), 1);
      sat = (1 - dist) ^ 2;
      val = sqrt(dist);

      toRGBA(hsva:[ hue, sat, val, 1 ])
    else
      rgba:[0,0,0,1]
    end
  end
end

filter JustCircles_p ()
  JustCircles(xy:[0.25 + 2.5 * x, 2.5 * y])
end

Offline Adam Majewski

  • *
  • Fractal Friar
  • *
  • Posts: 148
« Reply #1 on: June 21, 2019, 04:19:23 PM »
You are right that c has also complex type and in new programs I use it.


xx
Upload limits per day for Main and User Galleries?

Started by Anon on Discuss Fractalforums

13 Replies
561 Views
Last post September 22, 2017, 07:02:49 AM
by claude
question
Upload limits per day for Main and User Galleries (Sticky Topic/Post)

Started by Anon on Discuss Fractalforums

3 Replies
236 Views
Last post February 17, 2018, 08:13:59 PM
by 3DickUlus
xx
Mandelbrot Burning Ship Mandelbrot Mandelbrot hybrid 2

Started by claude on Fractal Image Gallery

0 Replies
210 Views
Last post January 17, 2018, 12:10:56 AM
by claude
xx
Mandelbrot Burning Ship Mandelbrot Mandelbrot hybrid 3

Started by claude on Fractal Image Gallery

0 Replies
245 Views
Last post January 17, 2018, 12:26:38 AM
by claude
xx
(Mandelbrot / Burning Ship / Mandelbrot / Mandelbrot) Hybrid

Started by claude on Fractal movie gallery

15 Replies
717 Views
Last post February 06, 2018, 04:56:54 AM
by claude