File:Mandelbrot d 9.png

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Original file(1,000 × 1,000 pixels, file size: 618 KB, MIME type: image/png)

Summary[edit]

Description
English: Mandelbrot set for fc(z)=z*z + c. Color of pixel is proportional to quadratn in which ninth ( last) iteration lands
Date
Source Made with c console program with help of Wolf Jung
Author Adam majewski

Long description[edit]

Color shows in which quadrant of a Cartesian coordinate system n-th iteration lands:

  • re(z_n) > 0 and im(z_n) > 0 (first quadrant)
  • re(z_n) < 0 and im(z_n) > 0 (second)
  • re(z_n) < 0 and im(z_n) < 0 (third)
  • re(z_n) > 0 and im(z_n) < 0 (fourth).

Because there are 4 quadrants then 4 colors are used .

"... when the four colors are meeting somewhere, you have a zero of q_n(c), i.e., a center of [hyperbolic component for] period dividing n. In addition, the light or dark color shows if c is in M." ( Wolf Jung )

compare with[edit]

Scr code[edit]

/* 
c console program:
          
----------------------------------------------------
 1. draws parameter plane for Fc(z)=z*z +c
  color shows in which quadrant zn lands. 4 colors are used because there are 4 quadrants : 
-------------------------------         
2. technic of creating ppm file is  based on the code of Claudio Rocchini
http://en.wikipedia.org/wiki/Image:Color_complex_plot.jpg
create 8 bit color ( shades of gray)  graphic file ,  portable pixmap file = PPM 
see http://en.wikipedia.org/wiki/Portable_pixmap
to see the file use external application ( graphic viewer)
---------------------------------

Adam Majewski
fraktal.republika.pl
{{Date|2010|04|02}}
*/
#include <stdio.h>
int main()
{
         /* screen ( integer) coordinate */
       int iX,iY;
       const int iXmax = 4000; 
       const int iYmax = 4000;
       /* world ( double) coordinate = parameter plane*/
       double Cx,Cy;
       const double CxMin=-2.5;
       const double CxMax=1.5;
       const double CyMin=-2.0;
       const double CyMax=2.0;
       /* */
       double PixelWidth=(CxMax-CxMin)/iXmax;
       double PixelHeight=(CyMax-CyMin)/iYmax;
        /* color component ( R or G or B) is coded from 0 to 255 */
       /* it is 24 bit color RGB file */
       const int MaxColorComponentValue=255; 
       static unsigned char color[1]; /* 8 bit color =  1 byte */
       FILE * fp;
       char *filename="d_9.ppm";
       char *comment="# ";/* comment should start with # */
       
       /* Z=Zx+Zy*i  ;   Z0 = 0 */
       double Zx, Zy;
       double Zx2, Zy2; /* Zx2=Zx*Zx;  Zy2=Zy*Zy  */
       /*  */
       int Iteration;
       const int IterationMax=9;
       /* bail-out value , radius of circle ;  */
       const double EscapeRadius=1000;
       double ER2=EscapeRadius*EscapeRadius;
       /*create new file,give it a name and open it in binary mode  */
       fp= fopen(filename,"wb"); /* b -  binary mode */
       /*write ASCII header to the file - 8 bit color*/
       fprintf(fp,"P5\n %s\n %d\n %d\n %d\n",comment,iXmax,iYmax,MaxColorComponentValue);
       /* compute and write image data bytes to the file*/
       for(iY=0;iY<iYmax;iY++)
       {
            Cy=CyMin + iY*PixelHeight;
            if (fabs(Cy)< PixelHeight/2) Cy=0.0; /* Main antenna */
            for(iX=0;iX<iXmax;iX++)
            {         
                      Cx=CxMin + iX*PixelWidth;
                       /* initial value of orbit = critical point Z= 0 */
                       Zx=0.0;
                       Zy=0.0;
                       Zx2=Zx*Zx;
                       Zy2=Zy*Zy;
                       /* */
                       for (Iteration=0;Iteration<IterationMax; Iteration++)
                       {
                           Zy=2*Zx*Zy + Cy;
                           Zx=Zx2-Zy2 +Cx;
                           Zx2=Zx*Zx;
                           Zy2=Zy*Zy;
                       };
                       /* compute  pixel color (8 bit = 1 byte) */
                      // if (Iteration==IterationMax) color[0]=0; /*  interior of Mandelbrot set = black */
                       /* exterior of Mandelbrot set = binary decomposition */             
                         // else 
                       if ((Zx>0) && (Zy>0)) color[0]=50;   /* 1-st quadrant */
                       if ((Zx<0) && (Zy>0)) color[0]=100; /* 2-nd quadrant */
                       if ((Zx<0) && (Zy<0)) color[0]=150; /* 3-rd quadrant */
                       if ((Zx>0) && (Zy<0)) color[0]=200; /* 4-th quadrant */
                       /*write color to the file*/
                       fwrite(color,1,1,fp);
               }
       }
       fclose(fp);
       printf("file saved\n");
       getchar();
      return 0;
}

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons

attribution share alike

This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
  • share alike – If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
You may select the license of your choice.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current11:16, 26 March 2011Thumbnail for version as of 11:16, 26 March 20111,000 × 1,000 (618 KB)Adam majewski (talk | contribs)Smaller size
11:15, 26 March 2011Thumbnail for version as of 11:15, 26 March 20114,000 × 4,000 (565 KB)Adam majewski (talk | contribs){{Information |Description ={{en|1=Mandelbrot set for fc(z)=z*z + c. Color of pixel is proportional to quadratn in which last iteration lands}} |Source ={{own}} |Author =Adam majewski |Date =2010-04-02 |
  • You cannot overwrite this file.

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file: