Fractals/color julia
Visualising complex functions
editSuppose we want to visualise a complex valued function like
In order to color we decompose it into its absolute value and its argument .
Then, we assign the color
to the point representing . In this HSV color space, all values are in the range from 0 to 1. The first component (hue) of the HSV color depends only on the argument of and the second and third component (saturation and value) depend only on the absolute value of . We use a transformation on to map it into the interval . For see section helper functions.
Examples
editThe values indexed s (saturation) control the transition saturated colors→white (resp. gray scale), i.e. intermediate values → infinity. The values indexed h (value/valenz) control the transition black→bright, i.e. zero→nonzero. Parameter a controls where the transition takes place: a is just the radius of the circle dividing the two regions (dark/bright, saturated/gray, etc.) Parameter b controls how sharp the transition is: b small = soft, b large = sharp.
The following images all show the range [10,10]×[10,10] and use (radius of rainbow) and (radius of black disc).
In the image with swapped meanings of S and V zero is printed in white and infinity in black.
Gallery
edit



Roles of S and V interchanged

n=1: starting values (color map)

n=2

n=3

n=4

n=17

n=18

n=19

n=20
Visualising Julia sets
editJulia sets and Fatou sets can be nice. Their computergraphical generation can be hard.
In the remainder of this page, we work out a method which can be used to visualise the Julia set of a complex function ƒ. The advantage is that you don't need to know attractors of the iteration
The generated images will be smooth in the Fatou part.
Overview: Imaging methods
editNote that there exist other approaches to color complex dynamical systems like
Inverse Iteration Method (IIM)
editCompute the preimages of ƒ, i.e. compute the reverse orbit. Because the stability of the fixed points turns from attractive to repelling and vice versa, one just choses a complex number and looks where it goes under the invers iteration. The trouble is that the results will not uniformly distributet in and that you have to compute the inverse of ƒ.
Coloring by speed of attraction (CSA)
editTaking a value from the lattice of points to color, perform iterations until the iterative is close to an attractor. Color the point according to the number of iterations needed to bring it close enough to the attractor.
This method is commonly used to visualize Julia sets of polynomials and Julia sets that are attached to Newton's famous method for finding the zeros of a function. Polynomials or degree > 1 always have infinity as a superattractive fixed point. The rational function that occurs in Newton's method has always the function's roots as attractive fixed points. However, in both cases there may be other attractors, which – moreover – need not to consist of just one point.
Escape Time Algorithm (ETA)
editIf ∞ is an attractor, i.e. a fixed point of the process, then color the point according to the number of iterations – the time – it takes until one sees the point escapes towards ∞. If the point does not escape during the maximum number of iterations, the point is colored as belonging to the Julia set or to the basin of some other attractor. This method works for polynomials. The most prominent Julia sets are the ones for z→z^{2}+c where c is an element of the Mandelbrot set or not far away from the mandelbrot set. If you see a picture of such a Julia set, it is likely that ETA had been used to get the picture.
Cauchy Convergence Algorithm (CCA)
editIn the remainder of this page, I will present a different approach whose idea as basically the same es that of Escape Time Algorithm. However, no basin of attraction must be known in advance and the different basins of attraction can be separated and be colored differently. The approch uses the notion of Cauchys convergence. Instead of observing the orbit of a point, this method observes how the distance of two nearby points z and z+ε evolves as these two values are iterated. If the difference tends to 0, then the point heads for an attractor. If the difference does not approach 0, then the point is close to (or a part of) the Julia set.
The Metric
editLet be a canonical projection of the compactified complex plane onto the Riemann sphere S_{2}:
This gives us a metric d: As distance between two points in the complex plane we take their distance on the sphere, i.e. the length of the orthodrome. This means that the metric is bounded by π and even the distance to ∞ (which is now the north pole) is finite.
In order to compute the distance between two points z and w we rotate the sphere S_{2} in such a way that
 w maps to 0
 z maps to the positive real axis
After these transformations the distance can be computed quite easily. The rotation can be accomplished by a squence of isometric Möbius transformations. All an all, we get
which is left as an exercise to the reader. The bar denotes complex conjugation. The metric is then
The nice feature that is introduced by d is that sequences that formerly diverged against infinity now converge towards infinity, i.e. towards the north pole of S_{2}.
Stability of Orbits
editRecall the definition of the Julia set for a contraction mapping ƒ. The definition implies some facts on the stability of the iteration
where ƒ^{n} denotes the nth iterative of ƒ:
The set
is called Orbit of z (under ƒ).
The orbits of two points z and w behave similar − in some sense − if z and w lie close together and belong to the Fatou set F_{ƒ} which is the complement of the Julia set J_{ƒ} of ƒ. If z is an element of J_{ƒ} then z and w will behave quite different, even if w itself is an element of J_{ƒ}.
To get a notion of the stability of an orbit, we set
for a small ε and with the metric d from above. This means that we take two points which are close together, and then we summarize their distances as ƒ makes them jump around on the Riemann sphere. Note that for any fixed ε the sum can diverge for large n even if z is a Fatou point.
However, we can use Σ_{n} to measure how close a point is to J_{ƒ}: the larger the sum is, the more instable is the iteration and the closer is the point to the Julia set of ƒ.
To destinguish points of (or close to) the Julia set from points in the Fatou set, we need a creterion. To get it, we compute all the Σvalues for the points that we want to color, i.e. for all points in a lattice Γ. After computing these values, we do a little bit of statistics to get the expected value E and the standard deviation σ for the set of Σvalues: Let
Remind that
It turns out that the values Σ are widely spread over several scales. Therefore, we do not use Σ directly. Instead, we use the logarithm of Σ. The value δ is just a small constant to avoid the logarithm's input to be zero.
Coloring
editNow, we have all we need to color a point:
 choose
 a lattice of points to color
 the number of iterations to perform
 a small
 for all points, compute
 compute and
 compute
for some constant . Because will be used to separate points that belong to the Julia set ( ) from points that to not ( ), reasonable values for are greater than . Try settings like or or the like. If then we color as belonging to the Julia set. If we can use that value to shade the Fatou set. If we know some attractor, we can check if ƒ^{$n$ } is close to it and use that information, too.
To map values to the valid ranges for saturation and brightness we use the function from section helper function h.
Modifications
editThe computation of takes a lot of time. The visualisation process needs two passes:
 compute from all
 color the points using and recomputed
Alternatively
 compute and store all
 compute and color the points
An other approach looks like that:
 Find the smallest so that is below a given bound for all . If no such can be found, then assume to be an element of the Julia set. Otherwise, use to color the Fatou set.
This algorithm is a variant of the escape time algorithm (ETA). Note that in ETA the point does not really escape (at least if we are on the sphere), it just converges to ∞. This approach is similar. However, we don't need to know an attractive fixed point of ƒ.
Up to now, I didn't try the modified version. One disadvantage may be that the Fatou set will no more appear smooth colored. Then I am not sure if this modification is really an advantage, because the iteration must be done until a given maximum number of iterations is reached. Note that even if is under the bound for some the distance can rise again. I cannot say if this effect is crucial or can be neglected...
Gallery
editdenotes the Newton operator
Using Critical Points Absorption (CPA)
editThe previous method yeilds neat, smooth colorings and requires least knowledge about the dynamics of the process. However, it is quite time consuming. Teh following approach is an extension of escape time algorithm (ETA) for polynomials.
Let ƒ be a polynomial of degree d > 1 over C. Such a polynomial has at most d critical points: infinity and the at most d–1 zeroes of ƒ′. It is well known that each attractor of the process z→ƒ(z) absorbs at least one critical point. Suppose z_{K} is a critical value, then ƒ^{n}(z_{K}) comes arbitrarirly close to one of the attractive cycles of ƒ.
A process for a quadratic polynomial ƒ(z) = z^{2} + c is the simplest case: The critical values are 0 and ∞. As ∞ absorbs itself, only 0 is left, and we have the following cases. M denotes the Mandelbrot set.
 Easy case. 0 is absorbed by ∞, and J(ƒ) consists just of Cantor dust. Escape time to ∞ can be used to color all points.
 If c is an element of the interior of M, then 0 will be absorbed by a (super) attractive cycle. Compute
 for a sufficiently large n. As w (basically) only depends on c, it can be precomputed before starting the visualization of J(ƒ). Notice that w is the element of a cycle that might have more than one element, i.e. w is only unique modulo that cycle.
 Coloring for a point z in C is then as easy as ETA:
 If z is absorbed by ∞, use escape time to color z.
 If ƒ^{n}(z) comes close to w, i.e if ƒ^{n}(z) – w < ε for the first time, use that n to color z.
 If ƒ^{n}(z) neither comes close to ∞ nor comes close to w, then color z as part of J(ƒ). Only few z will fall into this category.
Helper functions
editHelper function t
editis a smooth, monotone sigmoidal transition from −1 to 1 that satisfies and . There are many choices for it. Some of them are
with gd denoting the gudermannian function.
 All functions in a Desmos plot.
Helper function h
editHelper function is almost the same like but it maps to and we can adjust the speed of transition by parameter .
with . Then is symmetric to the point (0, 1/2) and
Negative values are mapped to values between 0 and 1/2. Positive values are mapped to values between 1/2 and 1. The parameter controls how fast the transition will be.
If we want a falling function, we can use the symmetry
i.e. we negate or .
Helper function g
editThis function maps the positive numbers to the interval .
for some function that is defined below. If is appropriately chosen then for the following holds
This means that
 grows continuously from 0 to 1 as grows from to
 we can control where crosses the middle between 0 and 1 by specifying parameter
 we can control how fast passes the point by specifying parameter
We are left with determining the finction on with
must satisty
For we set
Helper function w
editThis function maps the positive numbers to the interval .
By we can control its slope in the origin:
Circular arc through (0,0) and (1,1)
editA circular arc through (0,0) and (1,1) that has given slope of in (0,0) and in (1,1):
where
The center of the circle is incident on the line .
See also
edit coloring the parameter plane and the Mandelbrot set
 general coloring algorithms: ( feature of the pixel > color ):