Loading [MathJax]/jax/output/HTML-CSS/jax.js

mathr / blog / #

Interior coordinates in the Mandelbrot set

Interior coordinates in the Mandelbrot set

There is an algorithm to find points on the boundary of the Mandelbrot set, given a particular hyperbolic component and the desired internal angle. It involves Newton's method in two complex variables to solve

Fp(z,c)=zzFp(z,c)=b

where F0(z,c)=z and Fq+1(z,c)=Fq(F(z,c)2+c), p is the period of the target component, and b=e2πiθ with the θ the desired internal angle. The resulting c is the coordinates of the point on the boundary. It can also be modified to find points in the interior, simply set b=re2πiθ with |r|1.

After seeing this fractal Mandelbrot in an IRC channel, I wondered if it was possible to invert the algorithm, namely find b given c, and use b as polar texture coordinates to place copies of an image inside the Mandelbrot fractal. The answer is yes, and in some sense it's actually easier than the other direction.

The algorithm I developed works like this:

  1. When c is outside the Mandelbrot set, give up now;
  2. For each period p, starting from 1 and increasing:
    1. Find z0 such that Fp(z0,c)=z0 using Newton's method in one complex variable;
    2. Find b by evaluating zFp(z,c) at z0;
    3. If |b|1 then return b, otherwise continue with the next p.

I wrote this implementation.