411 REFERENCE · Wikibooks
Fractals/Iterations in the complex plane/Mandelbrot set interior
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
This book shows how to code different algorithms for drawing parameter planeparameter plane in wikipedia (Mandelbrot setMandelbrot set in wikipedia) for complex quadratic polynomial.complex quadratic polynomial in wikipedia
One can find different types of points / sets on parameter plane.reenigne blog : mandelbrot-set-taxonomy
This page is about interior points of the Mandelbrot set.Displaying the Internal Structure of the Mandelbrot Set by A Cunningham ( with python 3 program and code)
Interior of Mandelbrot set - hyperbolic components
The “Capture-Time” Algorithm: Iterations needed to Converge
The “capture-time algorithm” is a natural counterpart for points inside the set to the “escape-time algorithm”. Given some desired tolerance, the orbit P is generated for each point c ∈ C until some point in the orbit is closer than to some previous point in the orbit. The number of iterations needed for this to occur is mapped to a color and displayed at the pixel corresponding to c. Adam CunninghamDisplaying the Internal Structure of the Mandelbrot Set by Adam Cunningham
The Lyapunov exponent
Math equation :The logistic equation by Didier Gonze October 4, 2013
where:
means first derivative of f with respect to z
See also:
image and description by janthorLjapunov Exponent and mandelbrot set by janthor
image by Anders SandbergImage by Anders Sandberg
HLSL code by JPBotelhogithub repo JPBotelho: Fractal-Megacollection ( HLSL shaders for Unity)
Shader "Fractals/Coloring Techniques/Escape-Time"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Iter ("Iterations", Range(0, 250)) = 100
_Dividend ("Dividend", Range (0, 0.5)) = 15
_Zoom ("Zoom", Range (0.1, 1000)) = 0.65
_Position ("Offset", Vector) = (0.4, 0, 0, 0)
_Background ("Background", Color) = (0, 0.25, 1, 0)
_Origin ("Origin", Color) = (0, 0, 0, 0)
}
SubShader
{
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "Complex.cginc"
#include "FractalOperations.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
int _Iter;
fixed _Zoom;
fixed _Dividend;
float2 _Position;
fixed4 _Background;
fixed4 _Origin;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float x0 = (ClampScaleX(i.uv) + _Position.x) / _Zoom;
float y0 = (ClampScaleY(i.uv) + _Position.y) / _Zoom;
float2 z = float2(x0, y0);
float2 c = float2(x0, y0);
int iteration = 0;
float l = 0;
while (IsBounded(z, 40) && iteration < _Iter)
{
l += log (cabs(2 * z));
z = cmul(z, z);
z += c;
iteration++;
}
l /= iteration;
if (l > 0)
return _Background;
float3 color = tanh(l >= 0 ?
float3(0, 0.7 * log(1 + l), log(1 + l)) :
3 * float3(_Origin.x-l, _Origin.y-l * 0.1, _Origin.z));
return float4(color + _Dividend, 1);
}
ENDCG
}
}
CustomEditor "FractalEditor"
}
Interior distance estimation
thumb|Interior distance estimation
DEM/M - description of the method
absolute value of the orbit
# Hypercomputing the Mandelbrot Set? by Petrus H. Potgieter February 1, 2008
n=1000; # For an nxn grid
m=50; # Number of iterations
c=meshgrid(linspace(-2,2,n))\ # Set up grid
+i*meshgrid(linspace(2,-2,n))’;
x=zeros(n,n); # Initial value on grid
for i=1:m
x=x.^2+c; # Iterate the mapping
endfor
imagesc(min(abs(x),2.1)) # Plot monochrome, absolute
# value of 2.1 is escape
internal level sets
Color of point:
is proportional to the value of z is at final iteration.
shows internal level sets of periodic attractors.
bof60
Image of bof60 in on page 60 in the book "the Beauty Of Fractals".Description of the method described on page 63 of bof. It is used only for interior points of the Mandelbrot set.
Color of point is proportional to:
the smallest distance of its orbit from origin Fractint : Misc. Options and algorithmsJava™ Number Cruncher: The Java Programmer's Guide to Numerical Computing By Ronald Mak
the smallest value z gets during iterationFirefly Application Help by Terry W. Gintz
illuminating the closest approach the iterates of the origin (critical point) make to the origin inside the set
"Each pixel of each particular video frame represents a particular complex number c = a + ib. For each sequential frame n, the magnitude of z(c,n) := z(c, n-1)^2 + c is displayed as a grayscale intensity value at each of these points c: larger magnitude points are whiter, smaller magnitudes are darker. As n rises from 1 to 256, points outside the Mandelbrot Set quickly saturate to pure white, while points within the Mandelbrot Set oscillate through the darker intensities." Brian GawaltMandelbrot Oscillations by Brian Gawalt
Level sets of distance are sets of points with the same distanceFractint doc by Noel Giffin
if (Iteration==IterationMax)
/* interior of Mandelbrot set = color is proportional to modulus of last iteration */
else { /* exterior of Mandelbrot set = black */
color[0]=0;
color[1]=0;
color[2]=0;
}
fragment of code : fractint.cfrm from Gnofract4dgnofract4d
bof60 {
init:
float mag_of_closest_point = 1e100
loop:
float zmag = |z|
if zmag < mag_of_closest_point
mag_of_closest_point = zmag
endif
final:
#index = sqrt(mag_of_closest_point) * 75.0/256.0
}
See also
Mandelbrot Trajectory Infima by jeremy-rifkin Jeremy Rifkin
Displaying the Internal Structure of the Mandelbrot Set by Adam Cunningham
bof61 or atom domains
Full description
Period of hyperbolic components
right|thumb|period of hyperbolic components
Period of hyperbolic component of Mandelbrot set is a period of limit set of critical orbit.
Algorithms for computing period:
direct period detection from iterations of critical point z = 0.0 on dynamical plane
"quick and dirty" algorithm : check if then colour c-point with colour n. Here n is a period of attracting orbit and eps is a radius of circle around attracting point = precision of numerical computations
"methods based on interval arithmetic when implemented properly are capable of finding all period-n cycles for considerable large n." (ZBIGNIEW GALIAS )Rigorous Investigations Of Periodic Orbits In An Electronic Circuit By Means Of Interval Methods by Zbigniew Galias
Floyd's cycle-finding algorithmMandelbrot set drawing by Milan
the spider algorithm
atom domain, BOF61
Period detection
interior detection
Pixel is interior with high probability if all below is fractalforums.org : determining-optimal-iterations-to-skip-with-series-approximation
pixel is marked as interior ( black)
all surrounding pixels are marked as interior ( black)
all the black pixels have the same period
internal coordinate and multiplier map
thumb|right|Components of Mandelbrot set computed using multiplier map
thumb|right|Mandelbrot set - multiplier map
definition
interior coordinateinterior_coordinates_in_the_mandelbrot_set by Claude Heiland-Allenpractical interior_distance rendering by Claude Heiland-Allenmath.stackexchange question: test-for-membership-in-mandelbrot-bulb-of-period-n/1151953#1151953
The algorithm by Claude Heiland-Allen:
check c
When c is outside the Mandelbrot set
give up now
or use external coordinate
when c is not outside (inside or on the boundary) : For each period p, starting from 1 and increasing:
Find periodic point z0 such that fp(z0,c)=z0 using Newton's method in one complex variable
Find b by evaluating first derivative with respect to z of fp at z0
If |b|≤1 then return b, otherwise continue with the next p
computing
For periods:Brown Method by Robert P. Munafo, 2003 Sep 22.
1 to 3 explicit equations can be usedExact Coordinates by Robert P. Munafo, 2003 Sep 22.
>3 it must be find using numerical methods
period 1
Start with boundary equation:
c+(w/2)^2-w/2=0;
and solve it for w
(%i1) eq1:c+(w/2)^2-w/2=0;
2
w w
(%o1) -- - - + c = 0
4 2
(%i2) solve(eq1,w);
(%o2) [w = 1 - sqrt(1 - 4 c), w = sqrt(1 - 4 c) + 1]
(%i3) s:solve(eq1,w);
(%o3) [w = 1 - sqrt(1 - 4 c), w = sqrt(1 - 4 c) + 1]
(%i4) s:map(rhs,s);
(%o4) [1 - sqrt(1 - 4 c), sqrt(1 - 4 c) + 1]
so
w = w(c) = 1.0 - csqrt(1.0-4.0*c)
period 2
w = 4.0*c + 4;
period 3
It can be solved using Maxima CAS:
(%i1) e1:c^3 + 2*c^2 - (w/8-1)*c + (w/8-1)^2 = 0;
3 2 w w 2
(%o1) c + 2 c + (1 - -) c + (- - 1) = 0
8 8
(%i2) solve(e1,w);
(%o2) [w = (- 4 sqrt((- 4 c) - 7) c) + 4 c + 8, w = 4 sqrt((- 4 c) - 7) c + 4 c + 8]
numerical approximation
complex double AproximateMultiplierMap(complex double c, int period, double eps2, double er2)
{
complex double z; // variable z
complex double zp ; // periodic point
complex double zcr = 0.0; // critical point
complex double d = 1;
int p;
// first find periodic point
zp = GivePeriodic( c, zcr, period, eps2, er2); // Find periodic point z0 such that Fp(z0,c)=z0 using Newton's method in one complex variable
// Find w by evaluating first derivative with respect to z of Fp at z0
if ( cabs2(zp)<er2) {
z = zp;
for (p=0; p < period; p++){
d = 2*z*d; /* first derivative with respect to z */
z = z*z +c ; /* complex quadratic polynomial */
}}
else d= 10000; //
return d;
}
See also:
Number Sequences in the Mandelbrot Set by the Mathemagicians' Guild
Internal angle
thumb|right|interior of Mandelbrots set coloured with radial angle
Method by Renato Fonseca :The Mandelbrot set by Renato Fonseca
"a point c in the set is given a hue equal to argument
(scaled appropriately so that we end up with a number in the range 0 - 255). The number z_nmax is the last one calculated in the z's sequence."
See also:
[Extra Visual] Building a Mandelbrot Set Step-by-step by The Mathemagicians' Guild
Fractint
Fractint : Color Parameters : INSIDE=ATAN
colors by determining the angle in degrees the last iterated value has with respect to the real axis, and using the absolute value. This feature should be used with periodicity=0fractint color params
Internal rays
From Hyperbolic to Parabolic Parameters along Internal RaysFrom Hyperbolic to Parabolic Parameters along Internal Rays by Yi-Chiuan Chen and Tomoki Kawahira
When varies and is constant then goes along internal ray.internal ray in wikipedia It is used as a path inside Mandelbrot set.
double complex Give_c(double t, double r, int p)
{
/*
input:
InternalRadius = r in [0,1]
InternalAngleInTurns = t in range [0,1]
p = period
output = c = complex point of 2D parameter plane
*/
complex double w = 0.0;
complex double c = 0.0;
t = t*2*M_PI; // from turns to radians
// point of unit circle
w = r* cexp(I*t);
// map circle to component
switch (p){
case 1: c = (2.0*w - w*w)/4.0; break;
case 2: c = (w -4.0)/ 4.0; break;
}
return c;
}
/* find c in component of Mandelbrot set
uses complex type so #include <complex.h> and -lm
uses code by Wolf Jung from program Mandel
see function mndlbrot::bifurcate from mandelbrot.cpp
http://www.mndynamics.com/indexp.html
*/
double complex GiveC(double InternalAngleInTurns, double InternalRadius, unsigned int period)
{
//0 <= InternalRay<= 1
//0 <= InternalAngleInTurns <=1
double t = InternalAngleInTurns *2*M_PI; // from turns to radians
double R2 = InternalRadius * InternalRadius;
double Cx, Cy; /* C = Cx+Cy*i */
switch ( period ) {
case 1: // main cardioid
Cx = (cos(t)*InternalRadius)/2-(cos(2*t)*R2)/4;
Cy = (sin(t)*InternalRadius)/2-(sin(2*t)*R2)/4;
break;
case 2: // only one component
Cx = InternalRadius * 0.25*cos(t) - 1.0;
Cy = InternalRadius * 0.25*sin(t);
break;
// for each period there are 2^(period-1) roots.
default: // safe values
Cx = 0.0;
Cy = 0.0;
break; }
return Cx+ Cy*I;
}
// draws points to memory array data
int DrawInternalRay(double InternalAngleInTurns, unsigned int period, int iMax, unsigned char data[])
{
complex double c;
double InternalRadius;
double RadiusStep; // between radius of points
int i; // number of point to draw
RadiusStep = 1.0/iMax;
for(i=0;i<=iMax;++i){
InternalRadius = i * RadiusStep;
c = GiveC(InternalAngleInTurns, InternalRadius, period);
DrawPoint(c,data);
}
return 0;
}
Example: internal ray of angle = 1/6 of main cardioid.
Internal angle:
radius of ray:
Point of internal radius of unit circle:
Map point to parameter plane:
For this is equation for main cardioid.
Internal curve
When is constant varies and varies then goes along internal curve.
/* find c in component of Mandelbrot set
uses complex type so #include <complex.h> and -lm
uses code by Wolf Jung from program Mandel
see function mndlbrot::bifurcate from mandelbrot.cpp
http://www.mndynamics.com/indexp.html
*/
double complex GiveC(double InternalAngleInTurns, double InternalRadius, unsigned int period)
{
//0 <= InternalRay<= 1
//0 <= InternalAngleInTurns <=1
double t = InternalAngleInTurns *2*M_PI; // from turns to radians
double R2 = InternalRadius * InternalRadius;
double Cx, Cy; /* C = Cx+Cy*i */
switch ( period ) {
case 1: // main cardioid
Cx = (cos(t)*InternalRadius)/2-(cos(2*t)*R2)/4;
Cy = (sin(t)*InternalRadius)/2-(sin(2*t)*R2)/4;
break;
case 2: // only one component
Cx = InternalRadius * 0.25*cos(t) - 1.0;
Cy = InternalRadius * 0.25*sin(t);
break;
// for each period there are 2^(period-1) roots.
default: // safe values
Cx = 0.0;
Cy = 0.0;
break;
}
return Cx+ Cy*I;
}
// draws points to memory array data
int DrawInternalCurve(double InternalRadius , unsigned int period, int iMax, unsigned char data[])
{
complex double c;
double InternalAngle; // in turns = from 0.0 to 1.0
double AngleStep;
int i;
// int iMax =100;
AngleStep = 1.0/iMax;
for (i=0; i<=iMax; ++i) {
InternalAngle = i * AngleStep;
c = GiveC(InternalAngle, InternalRadius, period);
DrawPoint(c,data);
}
return 0;
}
Centers of components
definition
Methods of finding centers
More tutorials and code
Tutorials
in Basic see Mandelbrot Dazibao
in Java see Evgeny Demidov
in C see Linas Vepstas
in C++ see Wolf Jung page,
in Factor program by Slava Pestov
in Gnuplot see Tutorial by T.Kawano
in Lisp (Maxima) see:
Dynamics by Jaime E. Villate
Mu-Ency - The Encyclopedia of the Mandelbrot Set by Robert P. Munafo
Frac by Yannick Gingras with beautiful
Fractals in Lisp by Takaya Iwamoto
in Octave see wikibooks or another version by Christopher Wellons
How to Plot the Mandelbrot Set By Hand
comparison of various languages:
Computer Language Benchmarks Game : Compare the performance of ≈30 programming languages using ≈12 flawed benchmarks for 4 different combinations of OS/machine.
rosettacode
Fractal Benchmark in Ruby, Io, PHP, Python, Lua, Java, Perl, Applescript, TCL, ELisp, Javascript, OCaml, Ghostscript, and C by Erik Wrenholt
in PDL, IDL, MATLAB, Octave, C and FORTRAN77 by Xavier Calbet
ASCI graphic :ASCII graphic
ASCII Graphics at Mu-Ency by Robert P. Munafo
using scripting languages by Warp
Fractal Benchmark by Theo Wollenleben
using Lisp on Bill Clementson's blog
3D
3D images of Mandelbrot set
3d images by Jos Leys
References