Fractals/Iterations in the complex plane/stripeAC

introduction
"Average colorings are a family of coloring functions that use the decimal part of the smooth iteration count to interpolate between average sums."

Here stripes are lines perpendicular to the iteration bands ( level sets of escape time). These " radial strands ... follows the external rays which are of great importance in the theoretical study of M and in holomorphic dynamics." (A Cheritat)

" is basically a cheap way to calculate an angle. TIA is averaging the angle over all iterations to get a smooth result. So there is some initialization and some calculations per iteration to do the sum. It has to store the sum at the previous iteration before adding the next one so you can interpolate between them to get a continuous function between iteration bands (in the same way that continuous potential is usually interpolated). This interpolation is done after the iterations bail out." (xenodreambuie - author of Jux)

" ... it probably shows curves close to external rays,  but nevertheless you do not have an explicit relation between the number returned by SAC and the true external argument." Wolf Jung

name

 * SAM = Stripe Average Method
 * SAC = Stripe Average Coloring
 * radial strands

history
A new coloring called the Stripe Average was introduced by Jussi Härkönen in 2007. It is based on the behavior of the Triangle Inequality Average coloring.

Images
fractalforums stripe-average-mandelbrot-2 by Zephitmaal

video

 * youtube: Mandelbrot Coloring Algorithms by sfract

algorithm
For every point c of rectangle from parameter plane do:
 * Calculate the orbit of the point z0. The result is series of complex numbers {z0,z1,z2,...}
 * Apply function t to this series to get a new series of real numbers: { t0=t(z0), t1=t(z1), t2=t(z2), ...}.
 * Take the average A ( = arithmetic mean) of this series of real numbers
 * map real number A to a color ( coloring function)

orbit
Truncated orbit:

$$\mathcal O _n (z) = \{z, z_1, z_2, \ldots z_n\}$$

Skipped orbit is a subset of truncated orbit:
 * skip a first k+1 of items from the sequence
 * do not use some first k+1 items to compute average

$$\mathcal O _{n,k} (z) = \{z_{n-k}, z_{n-k+1}, \ldots z_n\}$$

addend function
The addend function t
 * maps complex number $$z$$ to real number $$t_n$$
 * is continuous on the elements of elements in skipped orbit


 * $$ t_n = t(z_n) = \frac{sin(s*arg(z_n))}{2} +\frac{1}{2}$$


 * $$t\ \colon \mathbb{C} \to \mathbb{R} $$

where :
 * s is a stripe density

full
Average of full truncated orbit:
 * compute average from all points of the truncated orbit
 * $$A_n= A(\mathcal O_n) = \frac{1}{n}\sum_{i=0}^n t_i=\frac{t_0+ t_1+\cdots+t_n}{n}$$

If one compute average of all points ( from i=1 to i=n) then:
 * stripes will be visible ( good)
 * level sets of escape time will be also visible (bad, discontinuity )

The solution is :
 * the interpolation
 * skipped truncated orbit

skipped
Average of skipped orbit:
 * skip first (k+1) items from computing average


 * $$A_{n,k}=\frac{1}{n-k}\sum_{i=n-k}^n t_i=\frac{t_{n-k}+ t_{n-k+1}+\cdots+t_n}{n-k}$$

note that:

$$k < n$$

$$n-k = k+1$$

It removes some discontinuities but not level sets of escape time

interpolated
Level sets of escape time are still visible ( discontinuity). One can remove them using interpolation.

interpolation:
 * between 2 values
 * using:
 * linear function = linear interpolation
 * splines = spline interpolation
 * polynomial

steps:
 * Construct a smooth iteration count u = real number ( see equation 3.11 from page 21 in J Harkonen thesis)
 * take it's fractional part d

$$ u_n = u(z_n) = n + 1 + \frac{1}{ln(2)} ln \frac{ln(ER)}{ln(abs(z_n))}$$


 * $$d_n = \operatorname{frac} (u_n)\ =\ u_n - \lfloor u_n \rfloor\ for\ u_n \ge 0 $$

Decimal (frational) part d is:
 * zero at boundary of previous level set $$B_{n-1}$$
 * converges to 1 in the neighborhood of next level set boundary $$B_{n}$$

"Thus it can be used as the interpolation coefficient."

linear
To compute linear average $$A^l$$ interpolate between two values:
 * one obtained from the "full" series ( truncated and skipped) = Avg = $$A_n$$
 * one obtained from the average of all t elements except the last one = prevAvg = $$A_{n-1}$$

$$ A^l = d A_n + (1 - d)A_{n-1}$$

see equation 4.2 from page 28 in J Harkonen thesis

or in GLSL code by Syntopia:

Here is important fragment of GLSL code by Syntopia:

spline
Compute spline average $$A^s$$ using Catmull-Rom splines:

Polynomials $$H_i(d)$$:

$$ \begin{array}{lcl} H_0 = \tfrac{1}{2}(-d^2 + d^3)\\ H_1 = \tfrac{1}{2}(d + 4d^2-3d^3)\\ H_2 = \tfrac{1}{2}(2 - 5d^2 + 3d^3)\\ H_3 = \tfrac{1}{2}(-d+2d^2-d^3) \end{array} $$

then

$$ A^s = H_0A_n + H_1A_{n-1} + H_2A_{n-2} + H_3A_{n-3} $$

see equation 4.3 from page 28 in J Harkonen thesis

Code

 * java script by 2013 Douglas Haber
 * dailyfractalart explorer and description of js code
 * M set by Jeremy Ashkenas

C

 * M_LN2 is defined in math.h


 * 1) define M_LN2 0.69314718055994530942 /* log_e 2 */ The natural logarithm of the 2.

Ultra Fractal
Ultra Fractal Stripes {
 * uf
 * jh.ucl
 * Jussi Härkönen, 07-01-02
 * See Fibers and Things by Ron Barnett for a similar coloring
 * for convergent fractals.
 * TIA originally developed by Kerry Mitchell
 * Curvature originally developed by Damien Jones
 * 07-02-15 Added the interpolation mode parameter
 * 07-03-07 Added the "None" interpolation mode
 * 07-03-30 Added Skip iterations, seed (TIA only) and Mandel version (TIA only)
 * parameters
 * 16-10-30 Stripes + Perlin routines added by jam.
 * from jh.ucl
 * http://formulas.ultrafractal.com/cgi/formuladb?view;file=jh.ucl;type=.txt
 * 16-10-30 Stripes + Perlin routines added by jam.
 * from jh.ucl
 * http://formulas.ultrafractal.com/cgi/formuladb?view;file=jh.ucl;type=.txt
 * http://formulas.ultrafractal.com/cgi/formuladb?view;file=jh.ucl;type=.txt

global: ; Precalculate the attenuation factor for attenuated sum float attenuationFactor = 1 - exp(-@attenuation) float lp = log(log(@bailout)) float twopi = 2 * #pi

if (iteration > @skipIter) if (@coloring == "Stripes") ; Angle dependent component in [-1,1] float TkAng = sin(@angularFrequency * atan2(z) + @angularOffset)

; Radius-dependent component in [-1,1] float TkRad = sin(@circularFrequency * log((cabs(z))) + @circularOffset)

; The weighted sum of radius and angle dependent terms is in [-1,1] ; Scale and translate it to [0,1] Tk = 0.5 + 0.5 * ((1 - @circularWeight) * TkAng + @circularWeight * TkRad)

elseif (@coloring == "Curvature") ; Skip two first iterations in order to get two nonzero previous values

if (iteration > @skipIter + 2) q = (z - zPrev) / (zPrev - zPrev2) Tk = (abs(atan2(q)) / (pi)) else Tk = 0 endif else ; "TIA" ; Skip first iteration if (iteration > 1 + @skipIter) ; |z(k-1)^n| if (@usePixel) ; Use pixel value znAbs = cabs(z - #pixel) else ; Use seed specified by the user znAbs = cabs(z - @seed) endif

; Bounds: ; m(k) = ||z(k-1)|^n - |c|| float lowBound = abs(znAbs - cAbs) ; M(k) = |z(k-1)|^n + |c| float upBound = znAbs + cAbs

; T(k) Tk = (cabs(z) - lowBound) / (upBound - lowBound) endif endif

; Update previous sums sum3 = sum2 sum2 = sum1 sum1 = sum

; Calculate S(k) if (@attenuate) sum = attenuationFactor*sum + Tk else sum = sum + Tk endif

endif


 * 1) index = tempcolor
 * 1) index = tempcolor
 * 1) index = tempcolor

default: title = "Stripes"

param coloring caption = "Coloring mode" default = 0 enum = "Stripes" "TIA" "Curvature" hint = "Specifies the coloring algorithm." endparam

param usePixel caption = "Mandel version" default = false visible = @coloring == "TIA" hint = "Specifies whether to use the algorithm adapted \           to Julia or Mandelbrot sets" endparam

param seed caption = "Seed" default = (0.5,0.25) visible = (@coloring == "TIA") && (@usePixel == false) hint = "Seed of the Julia set." endparam

param interpolation caption = "Interpolation" default = 0 enum = "Linear" "Smooth" "None" hint = "Specifies the interpolation method." endparam

float param circularWeight caption = "Circle weight" default = 0.0 visible = (@coloring == "Stripes") min = 0 max = 1 hint = "Weight of circular and radial components. Weight = 0 shows only \           stripes, whereas weight = 1 shows only circles." endparam

float param circularFrequency caption = "Circle frequency" default = 5.0 visible = (@coloring == "Stripes") hint = "Specifies the density of circles. Use integer values for smooth results." endparam

float param circularOffset caption = "Circle offset" default = 0.0 visible = (@coloring == "Stripes") hint = "Circle offset given in radians." endparam

float param angularFrequency caption = "Stripe density" default = 5.0 visible = (@coloring == "Stripes") hint = "Specifies the density of stripes. Use integer values for smooth results." endparam

float param angularOffset caption = "Stripe offset" default = 0.0 visible = (@coloring == "Stripes") hint = "Stripe offset given in radians." endparam

int param skipIter caption = "Skip iterations" default = 0 hint = "Excludes a given number of iterations from the end of the orbit." endparam

; Fractional iteration count parameters float param bailout caption = "Bailout" default = 1e20 min = 1 hint = "Bail-out value used by the fractal formula. Use large bailouts for \     best results." endparam

; Attenuation parameters bool param attenuate caption = "Moving average" default = false hint = "Use moving average instead of average. This may make the coloring \     structure appear clearer (especially with TIA), but may also make busy \      areas to appear flat." endparam

float param attenuation caption = "Filter factor" default = 2 visible = @attenuate min = 0 hint = "Specifies the moving average strength. Values close to 0 cause the last \     terms to be weighted creating results similar to Cilia. Large values \      make the sum look more like the usual average." endparam }

Programs

 * fractview - blog - -branching-and-expsmooth, code
 * fractalmaker
 * deep-fractal by munrocket in java script

=References=