ファイル:Fatou componenets 3.png

ページのコンテンツが他言語でサポートされていません。

元のファイル(1,000 × 1,000 ピクセル、ファイルサイズ: 17キロバイト、MIME タイプ: image/png)

概要

解説
English: Filled Julia set with marked components ( shades of gray) for fc(z)=z*z + c where C=-0.12565651+0.65720*i. This image is inspired by this image by T Kawahira
Polski: Wypełniony zbiór Julii z zaznaczonymi składowymi ( odcienie szarości) dla fc(z)=z*z + c gdzie C=-0.12565651+0.65720*i; Obraz jest zaispirowany przez obraz T Kawahira
日付
原典 投稿者自身による著作物
作者 Adam majewski

概要

  • period = 3
  • c = -0.1256565100000000 ; 0.6572000000000000
  • periodic point zp = -0.1509373627736352 ; 0.2638003803965269
  • m = 0.9201569575722166 ; -0.0069986816652415
  • Internal Angle = 0.9987894964068370 = 0.1428571428571428 so periodic point is attracting and parameter c is inside period 3 component
  • internal radius = 0.9201835730513828 so point c is slightly rotated from internal ray for angle 0=1. One can see it on the image: how componets are twisted around fixed points and it's preimages.

See c program for computing multiplier map

Algorithm

  • create array for 8-bit colors ( shades of gray = numbers from 0 to 255)
  • fill array with data ( dynamical plane of fc(z) = z*z + c with filled Julia set )
  • apply Sobel filter ( result is in another array)
  • merge two arrays
  • save result array to pgm file
  • convert pgm file to png

Computing filled Julia set and its components

  • map array ( integer coordinate ) to dynamical plane ( z-plane) : (iX,iY) --> (Zx,Zy)
  • find attractor ( forward iteration of critical point )
  • for each point Z compute its External Last Iteration ( Escape Time).
  • if ( IterationMax != eLastIteration ) then mark it as exterir of filled julia set , else it is interior
  • for interior points find internal last iteration for which it is close to attractor and color this point proportionally to it

Compare with

Above image is inspired by this image by T Kawahira

C src code

It is c console program. To compile:

gcc -Wall c.c -lm

To run :

./a.out

It will create ct0.pgm file. To convert it to pgm with Image Magic use :

convert ct0.pgm c.png

Code has been formatted in Emacs

/*
  c console program
  -----------------------------------------
  1.ppm file code is  based on the code of Claudio Rocchini
  http://en.wikipedia.org/wiki/Image:Color_complex_plot.jpg
  create 24 bit color graphic file ,  portable pixmap file = PPM 
  see http://en.wikipedia.org/wiki/Portable_pixmap
  to see the file use external application ( graphic viewer)
  I think that creating graphic can't be simpler
  ---------------------------
  2. first it creates data array which is used to store color values of pixels,
  fills tha array with data and after that writes the data from array to pgm file.
  It allows free ( non sequential) acces to "pixels"
  -------------------------------------------
  Adam Majewski   fraktal.republika.pl 
 
  Sobel filter 
  Gh = sum of six values ( 3 values of matrix are equal to 0 ). Each value is = pixel_color * filter_coefficients 
 
*/
#include <stdio.h>
#include <math.h>
#include <complex.h>

/* escape time to infinity */
int GiveExtLastIteration(double _Zx0, double _Zy0,double C_x, double C_y, int iMax, double _ER2)
{ 
  int i;
  double Zx, Zy;
  double Zx2, Zy2; /* Zx2=Zx*Zx;  Zy2=Zy*Zy  */
  Zx=_Zx0; /* initial value of orbit  */
  Zy=_Zy0;
  Zx2=Zx*Zx;
  Zy2=Zy*Zy;
  for (i=0;i<iMax && ((Zx2+Zy2)<_ER2);i++)
    {
      Zy=2*Zx*Zy + C_y;
      Zx=Zx2-Zy2 +C_x;
      Zx2=Zx*Zx;
      Zy2=Zy*Zy;
    };
  return i;
}

double complex GiveAttractor(double _Cx, double _Cy, double ER2, int _IterationMax)
{
  int Iteration;
  double Zx, Zy; /* z = zx+zy*i */
  double Zx2, Zy2; /* Zx2=Zx*Zx;  Zy2=Zy*Zy  */
  /* -- find attractor ZA  using forward iteration of critical point Z = 0  */
  Zx=0.0;
  Zy=0.0;
  Zx2=Zx*Zx;
  Zy2=Zy*Zy;
  for (Iteration=0;Iteration<_IterationMax && ((Zx2+Zy2)<ER2);Iteration++)
    {
      Zy=2*Zx*Zy + _Cy;
      Zx=Zx2-Zy2 + _Cx;
      Zx2=Zx*Zx;
      Zy2=Zy*Zy;
    };
  return Zx+Zy*I;
}

/* attracting time to finite attractor ZA */
int GiveIntLastIteration(double _Zx0, double _Zy0,double C_x, double C_y, int iMax, double _AR2, double _ZAx, double _ZAy )
{ 
  int i;
  double Zx, Zy; /* z = zx+zy*i */
  double Zx2, Zy2; /* Zx2=Zx*Zx;  Zy2=Zy*Zy  */
  double d, dX, dY; /* distance from z to Alpha  */
  Zx=_Zx0; /* initial value of orbit  */
  Zy=_Zy0;
  Zx2=Zx*Zx;
  Zy2=Zy*Zy;
  dX=Zx-_ZAx;
  dY=Zy-_ZAy;
  d=dX*dX+dY*dY;
  for (i=0;i<iMax && (d>_AR2);i++)
    {
      Zy=2*Zx*Zy + C_y;
      Zx=Zx2-Zy2 +C_x;
      Zx2=Zx*Zx;
      Zy2=Zy*Zy;
      dX=Zx-_ZAx;
      dY=Zy-_ZAy;
      d=dX*dX+dY*dY;
    };
  return i;
}

int main(){
  const double Cx=-0.12565651,
    Cy=0.65720;
  unsigned char period=3; /* period of finite attractor */
  const int iXmax = 1000; 
  const int iYmax = 1000;
  int iX,iY,
    iWidth = iXmax + 1,
    iHeight= iYmax + 1;
  /* world ( double) coordinate = parameter plane*/
  const double ZxMin=-1.4;
  const double ZxMax=1.4;
  const double ZyMin=-1.4;
  const double ZyMax=1.4;
  double Zx, Zy;    /* Z=Zx+Zy*i   */
  double complex ZA;  /* atractor ZA = ZAx + ZAy*i */
  /* */
  double PixelWidth=(ZxMax-ZxMin)/iWidth;
  double PixelHeight=(ZyMax-ZyMin)/iHeight;
  const double EscapeRadius=80.0; /* radius of circle around origin; its complement is a target set for escaping points */
  double ER2=EscapeRadius*EscapeRadius;
  const double AR = PixelWidth/10; /* radius of circle around attractor ZA = target set for attracting points */
  double       AR2 = AR* AR;
  const int IterationMax=60,
    IterationMaxBig= 1000001;
  int eLastIteration, iLastIteration;
  unsigned char G, Gh, Gv; /* sobel filter */
  unsigned char data[iYmax][iXmax]; /* 2D array for colors ( shades of gray ) */
  unsigned char edge[iYmax][iXmax]; /* 2D array for colors ( shades of gray ) */
  unsigned char color[]={255,230,180};
  const int MaxColorComponentValue=255; /* color component is coded from 0 to 255 ;  it is 8 bit color file */
  FILE * fp;
  char *filename ="ct02.pgm";
  char *comment="# this is binary pgm  file";/* comment should start with # */
 
 ZA = GiveAttractor( Cx, Cy, ER2, IterationMaxBig); /* find attractor ZA  using forward iteration of critical point Z = 0  */
 /* fill the data array */
  for(iY=0;iY<iYmax;++iY){ 
    Zy=ZyMax - iY*PixelHeight; /* reverse Y  axis */
    if (fabs(Zy)<PixelHeight/2) Zy=0.0; /*  */    
    for(iX=0;iX<iXmax;++iX){ 
      Zx=ZxMin + iX*PixelWidth;
      eLastIteration = GiveExtLastIteration(Zx, Zy, Cx, Cy, IterationMax, ER2 );
      if ( IterationMax != eLastIteration ) 
	{data[iY][iX]=245;} /* exterior */
      else /* interior */
	{ iLastIteration = GiveIntLastIteration(Zx, Zy, Cx, Cy, IterationMaxBig, AR2, creal(ZA), cimag(ZA));
          data[iY][iX]=color[iLastIteration % period];} /* 255 - 30*(iLastIteration % period);}*/
      /* if (Zx>0 && Zy>0) data[iY][iX]=255-data[iY][iX];    check the orientation of Z-plane by marking first quadrant */
   }
 }
  /* find boundaries - Sobel filter
    for points not the borders of data array 
 */
  for(iY=1;iY<iYmax-1;++iY){ 
    for(iX=1;iX<iXmax-1;++iX){ 
      Gv= data[iY+1][iX-1] + 2*data[iY+1][iX] + data[iY+1][iX-1] - data[iY-1][iX-1] - 2*data[iY][iX-1] - data[iY-1][iX+1];
      Gh= data[iY+1][iX+1] + 2*data[iY][iX+1] + data[iY-1][iX-1] - data[iY-1][iX+1] - 2*data[iY][iX-1] - data[iY-1][iX-1];
      G = sqrt(Gh*Gh + Gv*Gv);
      if (G==0) {edge[iY][iX]=255;} /* background */
      else {edge[iY][iX]=0;}  /* boundary */
    }
  }

  for(iY=1;iY<iYmax-1;++iY){ 
    for(iX=1;iX<iXmax-1;++iX){ if (edge[iY][iX]==0) data[iY][iX]=0;}}

  /* write the whole data array to ppm file in one step */      
  fp= fopen(filename,"wb"); /*create new file,give it a name and open it in binary mode  */
  fprintf(fp,"P5\n %s\n %d\n %d\n %d\n",comment,iXmax,iYmax,MaxColorComponentValue);  /*write header to the file*/
  fwrite(data,sizeof data,1,fp);  /*write image data bytes to the file*/
  fclose(fp);
  printf("OK - file %s saved\n", filename);
  return 0;
}

ライセンス

この作品の著作権者である私は、この作品を以下のライセンスで提供します。
w:ja:クリエイティブ・コモンズ
表示 継承
このファイルはクリエイティブ・コモンズ 表示-継承 3.0 非移植ライセンスのもとに利用を許諾されています。
あなたは以下の条件に従う場合に限り、自由に
  • 共有 – 本作品を複製、頒布、展示、実演できます。
  • 再構成 – 二次的著作物を作成できます。
あなたの従うべき条件は以下の通りです。
  • 表示 – あなたは適切なクレジットを表示し、ライセンスへのリンクを提供し、変更があったらその旨を示さなければなりません。これらは合理的であればどのような方法で行っても構いませんが、許諾者があなたやあなたの利用行為を支持していると示唆するような方法は除きます。
  • 継承 – もしあなたがこの作品をリミックスしたり、改変したり、加工した場合には、あなたはあなたの貢献部分を元の作品とこれと同一または互換性があるライセンスの下に頒布しなければなりません。

キャプション

このファイルの内容を1行で記述してください

このファイルに描写されている項目

題材

13 7 2011

ファイルの履歴

過去の版のファイルを表示するには、その版の日時をクリックしてください。

日付と時刻サムネイル寸法利用者コメント
現在の版2011年7月13日 (水) 15:452011年7月13日 (水) 15:45時点における版のサムネイル1,000 × 1,000 (17キロバイト)Soul windsurfer

以下のページがこのファイルを使用しています:

グローバルなファイル使用状況