Fractals/Computer graphic techniques/2D/plane

From Wikibooks, open books for an open world
Jump to: navigation, search



2D plane can be described by :

  • corners ( 4 points )
  • center and width
  • center and magnification ("If you use the center, you can change the zoom level and the plot zooms in/out smoothly on the same center point. " Duncan C)

Standard description in Fractint, Ultra Fractal, ChaosPro and Fractal Explorer are corners. For example initial plane for Mandelbrot set is

 Corners:                X                     Y
 Top-l          -2.5000000000000000    1.5000000000000000
 Bot-r           1.5000000000000000   -1.5000000000000000
 Ctr -0.5000000000000000   0.0000000000000000  Mag 6.66666667e-01
 X-Mag-Factor     1.0000   Rotation    0.000   Skew    0.000

Display window of parameter plane has :

  • a horizontal width of 4 (real)
  • a vertical width (height) of 3 (imag)
  • an aspect ratio (proportion) 4/3 ( also in pixels 640/480 so ther is no distorsion)
  • center z=-0.5

For julia set/ dynamic plane has :

Corners:                X                     Y
Top-l          -2.0000000000000000    1.5000000000000000
Bot-r           2.0000000000000000   -1.5000000000000000
Ctr  0.0000000000000000   0.0000000000000000  Mag 6.66666667e-01
X-Mag-Factor     1.0000   Rotation    0.000   Skew    0.000

Description from documentation of Fractint :


Example: corners=-0.739/-0.736/0.288/0.291

Begin with these coordinates as the range of x and y coordinates, rather than the default values of (for type=mandel) -2.0/2.0/-1.5/1.5. When you specify four values (the usual case), this defines a rectangle: x- coordinates are mapped to the screen, left to right, from xmin to xmax, y-coordinates are mapped to the screen, bottom to top, from ymin to ymax. Six parameters can be used to describe any rotated or stretched parallelogram: (xmin,ymax) are the coordinates used for the top-left corner of the screen, (xmax,ymin) for the bottom-right corner, and (x3rd,y3rd) for the bottom-left. Entering just "CORNERS=" tells Fractint to use this form (the default mode) rather than CENTER-MAG (see below) when saving parameters with the [B] command.


This is an alternative way to enter corners as a center point and a magnification that is popular with some fractal programs and publications. Entering just "CENTER-MAG=" tells Fractint to use this form rather than CORNERS (see above) when saving parameters with the [B] command. The [TAB] status display shows the "corners" in both forms. When you specify three values (the usual case), this defines a rectangle: (Xctr, Yctr) specifies the coordinates of the center of the image.

Mag indicates the amount of magnification to use. Initial value ( no zoom ) is 6.66666667e-01.

Six parameters can be used to describe any rotated or stretched parallelogram: Xmagfactor tells how many times bigger the x- magnification is than the y-magnification,

Rotation indicates how many degrees the image has been turned.

Skew tells how many degrees the image is leaning over. Positive angles will rotate and skew the image counter-clockwise.

Parameters can be saved to parmfile called fractint.par

Wolf Jung uses :

   from mndlbrot.cpp  by Wolf Jung (C) 201
   These classes are part of Mandel 5.7, which is free software; you can
   redistribute and / or modify them under the terms of the GNU General
   Public License as published by the Free Software Foundation; either
   version 3, or (at your option) any later version. In short: there is
   no warranty of any kind; you must redistribute the source code as well
void mndlbrot::startPlane(int sg, double &xmid, double &rewidth) const
{  if (sg > 0) 
     { xmid = -0.5; rewidth = 1.6; } // parameter plane
     else { xmid = 0; rewidth = 2.0; } // dynamic plane


Check orientation of the plane by marking first quadrant of Cartesian plane :

if (x>0 && y>0) Color=MaxColor-Color; 

It should be in upper right position.

Pixel size[edit]

Pixel size is size of pixel in world coordinate. For linear scale and same resolution on both axes :

iSize = iXmax - iXmin ; // width of image in pixels ( integer or screen ) coordinate ; pixels are numbered from iXmin to iXmax; image is rectangular
fSize = CxMax-CxMin // width of image in world ( floating point ) coordinate
PixelWidth = fWidth / iWidth
PixelSize = PixelWidth // 
ZoomFactor iSize fSize PixelSize
1 = 1.0e0 1000 3.0 0,003
100 = 1.0e2 1000 0.03 0.00003
1000 = 1.0e3 1000 0.003 0.0000003



What precision do I need for zoom ?


See :

  • Fractint Drawing Methods[3]
  • Fratal Witchcraft drawing methods by Steven Stoft[4]
  • AlmondBread algorithms [5]

All the pixels[edit]

Scan the plane :

  • all pixels ( plane is scaned pixel by pixel )
  • the same pixel size

Here in Lisp

; common lisp. Here float values can be used,  there is no mapping
(loop for y from -1.5 to 1.5 by 0.1 do
      (loop for x from -2.5 to 0.5 by 0.05 do
            (princ (code-char 42))) ; print char
      (format t "~%")) ; new line

and in C

/* c */
/* screen coordinate = coordinate of pixels */      
int iX, iY, 
iXmin=0, iXmax=1000,
iYmin=0, iYmax=1000,
/* world ( double) coordinate = parameter plane*/
const double ZxMin=-5;
const double ZxMax=5;
const double ZyMin=-5;
const double ZyMax=5;
/* */
double PixelWidth=(ZxMax-ZxMin)/iWidth;
double PixelHeight=(ZyMax-ZyMin)/iHeight;
double Zx, Zy,    /* Z=Zx+Zy*i   */
       Z0x, Z0y,  /* Z0 = Z0x + Z0y*i */
      { Z0y=ZyMin + iY*PixelHeight; /* mapping from screen to world; reverse Y  axis */
        if (fabs(Z0y)<PixelHeight/2) Z0y=0.0; /* Zy = 0 is a special value  */    
         {    /* initial value of orbit Z0 */
           Z0x=ZxMin + iX*PixelWidth;

Plane transformations[edit]


Mandelbrot zoom created using Double-double precision


If you want to zoom [6]

baseSize // constant value =  extend in real and imaginary axis when zoomLevel is zero.
zoomLevel // inital value = 0.0
zoomFactor = 2^(-zoomLevel) // initial value = 1.0 = no zoom
sizeX = zoomFactor * baseSize
sizeY = zoomFactor * baseSize   
minImaginary = centerY - sizeY/2
maxImaginary = centerY + sizeY/2

Note that base of zoom factor is important when one wants to optimize zooming by using previosly computed pixels.

Usually other notation is used :

baseSize // constant value =  extend in real and imaginary axis when zoomLevel is zero.
zoomLevel // inital value = 0.0
zoomFactor = 10^zoomLevel // initial value = 1.0 = no zoom
sizeX =  baseSize / zoomFactor
sizeY = baseSize / zoomFactor   
minImaginary = centerY - sizeY/2
maxImaginary = centerY + sizeY/2

Maximal zoom[edit]

Maximal zoom factor is :

Maximal zoom is correlated with :

  • precision ( single , double, Quadruple precision, multiple-precision (MP) )[9][10]
  • algorithm

Examples :

  • zoom factor for video [11]
  • zoom factor [12]


Möbius transformation[edit]

Riemann sphere

A Möbius transformation of the extended complex plane ( the Riemann sphere ) :

f\colon \hat{\mathbf{C}} \rightarrow \hat{\mathbf{C}}

is a rational function with general for :

 f(z) =\frac{az+b}{cz+d}

It's inverse function in general form is :

f^{-1}(w) = \frac{dw-b}{-cw+a}

Specifying a transformation by three points[edit]

Given a set of three distinct points z1, z2, z3 on the one Riemann sphere ( let's call it z-sphere) and a second set of distinct points w1, w2, w3 on the second sphere ( w-sphere) , there exists precisely one Möbius transformation f(z) with :

  •  f(z_i) = w_i
  • f^{-1}(w) = z_i

for i=1,2,3

Mapping to 0, 1, infinity[edit]

The Möbius transformation with an explicit formula :[14]

f(z)= \frac {(z-z_1)(z_2-z_3)}{(z-z_3)(z_2-z_1)}

maps :

  • z1 to w1= 0
  • z2 to w2= 1
  • z3 to w3= ∞
the unit circle to the real axis - first method[edit]

Let's choose 3 z points on a circle :

  • z1= -1
  • z2= i
  • z3= 1

then the Möbius transformation will be :

f(z)= \frac {(z+1)(i-1)}{(z-1)(i+1)}

Knowing that : [15]

i+1 = -i (i -1 )

one can simplify this to :

f(z)= i \frac {z+1}{z-1}

In Maxima CAS one can do it :

(%i1) rectform((z+1)*(%i-1)/((z-1)*(%i+1)));
(%o1) (%i*(z+1))/(z−1)

where coefficients of the general form are :

a = i
b = i
c = 1
d = -1

so inverse function can be computed using general form :

f^{-1}(w) = \frac{dw-b}{-cw+a} = \frac{-i - w}{i-w}

Lets check it using Maxima CAS :

(%i3) fi(w):=(-%i-w)/(%i-w);
(%o3) fi(w):=−%i−w/%i−w
(%i4) fi(0);
(%o4) −1
(%i5) fi(1);
(%o5) −%i−1/%i−1
(%i6) rectform(%);
(%o6) %i

Find how to compute it without symbolic computation program (CAS)  :

(%i3) fi(w):=(-%i-w)/(%i-w);
(%o3) fi(w):=−%i−w/%i−w
(%i8) z:x+y*%i;
(%o8) %i*y+x
(%i9) z1:fi(w);
(%o9) (−%i*y−x−%i)/(−%i*y−x+%i)
(%i10) realpart(z1);
(%o10) ((−y−1)*(1−y))/((1−y)^2+x^2)+x^2/((1−y)^2+x^2)
(%i11) imagpart(z1);
(%o11) (x*(1−y))/((1−y)^2+x^2)−(x*(−y−1))/((1−y)^2+x^2)
(%i13) ratsimp(realpart(z1));
(%o13) (y^2+x^2−1)/(y^2−2*y+x^2+1)
(%i14) ratsimp(imagpart(z1));
(%o14) (2*x)/(y^2−2*y+x^2+1)
2 steps of unrolling the main cardioid of Mandelbrot set: Moebius map and conformal map
Unrolled main cardioid of Mandelbrot set for periods 7-13

So using notation :

 z = x + yi = f^{-1}(w)

one gets :

 x = \operatorname{Re}(z) = \operatorname{Re}(f^{-1}(w))   = \frac{y^2+x^2-1}{y^2-2y+x^2+1}

y = \operatorname{Im}(z) = \operatorname{Im}(f^{-1}(w))  = \frac{2x}{y^2-2y+x^2+1}

It can be used for unrolling the Mandelbrot set components [16]

the unit circle to the real axis - second method[edit]

Function :

f(z) = i\frac{z-1}{z+1}

sends the unit circle to the real axis :

  • z=1 to w=0
  • z=i to w=1
  • z=-1 to w=\infty

Mapping to the imaginary axis[edit]

Function f(z) = \frac{z-1}{z+1} sends the unit circle to the imaginary axis.[17]


  1. michael hogg : fractalnet
  2. optimizing zoom animations by Claude Heiland-Allen
  3. Fractint Drawing Methods
  4. Synchronous-Orbit Algorithm by R Munafo
  5. The Almond BreadHomepage by Michael R. Ganss
  6. stackoverflow : how-do-i-zoom-into-the-mandelbrot-set
  7. video Mandelbrot Zoom 999 on youtube by phaumann
  8. zooming with exteded precision in Delphi
  9. [:w:wiki/Talk:Floating_point/Archive_4#No_mention_of_Double-double No_mention_of_Double-double - talk]
  10. stackoverflow : mandelbrot-set-reaches-to-its-limit-way-too-soon
  11. fractalforums : problem with zooming transform one view rect-to another
  12. fractalforums "basic-location-and-zoom-question
  13. optimizing_zoom_animations by Claude Heiland-Allen
  14. Triple transitivity by David J Wright 2004-12-04
  15. math.stackexchange questions : how-to-do-this-transformation-of-complex-rational-function
  16. Stretching cusps by Claude Heiland-Allen
  17. math.stackexchange questions: what-mobius-transformation-maps-the-unit-circle-z-z-1-to-the-real-axis/335061#335061