Fun with Complex Quadratic Polynomial Julia Set by Using Julia Programing

Author

Steven Wang

Published

July 29, 2022

What is a Julia Set

Julia set was named after the French mathematician Gaston Julia, who studied the set in the early 20th century. Generally speaking, a Julia set is an area boundary formed by points in the complex number plane or the Riemann sphere (named after Bernhard Riemann, is a model of the extended complex plane: the complex plane plus one point at infinity) that diverge to infinity and those that remain finite under repeated iteration of some mapping (function). One particular Julia set with quadratic polynomials expression as in Equation 1 was risen to a well-known Mandelbrot set, where all points of the Julia set are connected.

The Julia set consists of values where a very small change in the c value can cause dramatic value changes in the sequence of iterated function outcomes. Therefore, the behavior of Julia sets is very turbulent, subject to the parameter c value change.

Julia set fractals are usually generated by initializing a complex number:

where i is imaginary unit such that

and x and y are real numbers represents image pixel coordinates in the range of about -2 to 2. Then, z is repeatedly updated using:
where c is another complex number that gives a specific Julia set. After numerous iterations, if the magnitude of z is less than 2 we say that pixel is in the Julia set and color it accordingly. Performing this calculation for a whole grid of pixels gives a fractal image.

Complex Quadratic Polynomial Julia Sets Examples

Code

functionjuliaset(z, c, R, N) n =0while n <= N &&abs(z) <= R^2- R n +=1 z = z^2+ cendreturn n > N ? 0: n/NendR, N, L, K = (2, 1000, 1500, 1000)x =range(-1.5, 1.5; length = L)y =range(-1.0, 1.0; length = K)A =zeros(K, L)