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 )
/* 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 Rocchinihttp://en.wikipedia.org/wiki/Image:Color_complex_plot.jpgcreate 8 bit color ( shades of gray) graphic file , portable pixmap file = PPM see http://en.wikipedia.org/wiki/Portable_pixmapto see the file use external application ( graphic viewer)---------------------------------Adam Majewskifraktal.republika.pl{{Date|2010|04|02}}*/#include<stdio.h>intmain(){/* screen ( integer) coordinate */intiX,iY;constintiXmax=4000;constintiYmax=4000;/* world ( double) coordinate = parameter plane*/doubleCx,Cy;constdoubleCxMin=-2.5;constdoubleCxMax=1.5;constdoubleCyMin=-2.0;constdoubleCyMax=2.0;/* */doublePixelWidth=(CxMax-CxMin)/iXmax;doublePixelHeight=(CyMax-CyMin)/iYmax;/* color component ( R or G or B) is coded from 0 to 255 *//* it is 24 bit color RGB file */constintMaxColorComponentValue=255;staticunsignedcharcolor[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 */doubleZx,Zy;doubleZx2,Zy2;/* Zx2=Zx*Zx; Zy2=Zy*Zy *//* */intIteration;constintIterationMax=9;/* bail-out value , radius of circle ; */constdoubleEscapeRadius=1000;doubleER2=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();return0;}
רישיון
אני, בעל זכויות היוצרים על היצירה הזאת, מפרסם אותה בזאת תחת הרישיונות הבאים:
ייחוס – יש לתת ייחוס הולם, לתת קישור לרישיון, ולציין אם נעשו שינויים. אפשר לעשות את זה בכל צורה סבירה, אבל לא בשום צורה שמשתמע ממנה שמעניק הרישיון תומך בך או בשימוש שלך.
שיתוף זהה – אם תיצרו רמיקס, תשנו, או תבנו על החומר, חובה עליכם להפיץ את התרומות שלך לפי תנאי רישיון זהה או תואם למקור.
מוענקת בכך הרשות להעתיק, להפיץ או לשנות את המסמך הזה, לפי תנאי הרישיון לשימוש חופשי במסמכים של גנו, גרסה 1.2 או כל גרסה מאוחרת יותר שתפורסם על־ידי המוסד לתוכנה חופשית; ללא פרקים קבועים, ללא טקסט עטיפה קדמית וללא טקסט עטיפה אחורית. עותק של הרישיון כלול בפרק שכותרתו הרישיון לשימוש חופשי במסמכים של גנו.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue
Optimized with OxiPNG and ZopfliPNG. Hilariously, the filesize got LARGER when you shrank the image resolution! Just goes to show you how BAD most programs (including GIMP) are at encoding PNGs.
{{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 |