Mandelbrot and Julia together

Whereas there is only one Mandelbrot set, there is one Julia set J_c for every complex number c. The Mandelbrot set M is an index of sorts into the Julia sets. If c\in M, then the Julia set J_c is connected. Alternatively, if c\notin M, then J_c is not connected, in which case J_c is charmingly referred to as fractal dust.

The following program shows the Mandelbrot set M on the front side of the square pane, and the corresponding Julia set J_c on the back. Here, the complex number c is fixed by the center of the current view of M. As you zoom and pan on M (and press Go), J_c is updated for the new value of c.1

Mandelbrot and Julia sets together

This joint Mandelbrot-Julia program is as efficient as the previous programs that render only one of the two sets. The fragment shader computes only one of the sets in each frame, depending on which side of the square pane is visible.

  1. The window on the complex plane varies for M under zoom and pan but remains fixed for the Julia sets.