Sample points on the boundary of the Mandelbrot-set

259 Views Asked by At

I'd like to know if theres a simple way of sampling points on the boundary of the Mandelbrot-set.

The last few hours I've been coding a bot to visualize a specific region of the set. I now want to randomly generate images taken from the set. My problem is that most images are plainly black/red (Inside/far outside the set) and not on the boundary where the interesting things happen.

I'd like to sample points that lie within the "interesting" regions of the set without having to regenerate until I find something that is.

I'm not sure how I'd start to do that so any help is very appreciated!

ps: I mentioned I was coding but I just need the mathematical approach which I will then convert myself.

1

There are 1 best solutions below

1
On

One algorithm that I've used:

  1. let "interesting" mean "contains boundary pixels"

  2. generate an image of the whole set at size $Z \times Z$ (where $Z = 4$ or so), by definition it is interesting

  3. repeat until $Z$ is as small as desired

    2.1. generate an image of part of the current image at size $\frac{Z}{2} \times \frac{Z}{2}$

    2.2. if the part is not interesting, go to 2.1

    2.3. set $Z$ to $\frac{Z}{2}$

The loop invariant that the current image is interesting ensures that the final image will be interesting.

To determine whether an image contains boundary pixels, one can compute a distance estimate for each pixel and compare the result against the pixel spacing: given $c$ the coordinates of the pixel, iterate the derivative w.r.t. $c$ along with $z$, and do some magic at the end after $z_n$ escaping a large radius $R$.

$$ D \approx \lim_{n \to \infty} 2 \frac{|z_n| \log |z_n|}{\left|\frac{\partial z_n}{\partial c}\right|} $$