Dosya:Parabolic julia set c = -1.125 + 0.21650635094611*i.png
Bu önizlemenin boyutu: 800 × 400 piksel. Diğer çözünürlükler: 320 × 160 piksel | 640 × 320 piksel | 1.024 × 512 piksel | 2.000 × 1.000 piksel.
Tam çözünürlük ((2.000 × 1.000 piksel, dosya boyutu: 19 KB, MIME tipi: image/png))
Bu dosya Wikimedia Commons'ta bulunmaktadır. Dosyanın açıklaması aşağıda gösterilmiştir. Commons, serbest/özgür telifli medya dosyalarının bulundurulduğu depodur. Siz de yardım edebilirsiniz. |
İçindekiler
Özet
AçıklamaParabolic julia set c = -1.125 + 0.21650635094611*i.png |
English: parabolic julia set for parameter . It is a root point between two Mandelbrot set components :
|
Tarih | |
Kaynak | Yükleyenin kendi çalışması |
Yazar | Adam majewski |
Diğer sürümler |
|
Lisanslama
Ben, bu işin telif sahibi, burada işi aşağıdaki lisans altında yayımlıyorum:
Bu dosya, Creative Commons Atıf-Benzer Paylaşım 3.0 Taşınmamış lisansı ile lisanslanmıştır
- Şu seçeneklerde özgürsünüz:
- paylaşım – eser paylaşımı, dağıtımı ve iletimi
- içeriği değiştirip uyarlama – eser adaptasyonu
- Aşağıdaki koşullar geçerli olacaktır:
- atıf – Esere yazar veya lisans sahibi tarafından belirtilen (ancak sizi ya da eseri kullanımınızı desteklediklerini ileri sürmeyecek bir) şekilde atıfta bulunmalısınız.
- benzer paylaşım – Maddeyi yeniden karıştırır, dönüştürür veya inşa ederseniz, katkılarınızı orijinal olarak aynı veya uyumlu lisans altında dağıtmanız gerekir.
C src code
Src code was formatted with Emacs
/*
this program draws parabolic Julia sets
it needs denominator of internal angle !!!
C is a common point of components for period 2 and 6 (trifurcation) of Mandelbrot set
Internal angle = 1/3 :
here c = exp(2*%pi*%i/3)/4 -1 = 0.21650635094611*%i-1.125
( It is a root point of denominator 6 component connected with denominator 2 component of Mandelbrot set )
denominator 2 parabolic cycle :
z0:0.1703125096583*%i-1.135614939209353;
z1:0.13561493920935-0.1703125096583*%i;
with external rays : (22/63 , 25/63, 37/63 ) landing on z1
with external rays : (11/63 , 44/63, 58/63 ) landing on z0
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 rgb color values of pixels,
fills tha array with data and after that writes the data from array to pgm file.
It alows free ( non sequential) access 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
gcc e.c -lm -Wall
gcc e.c -lm -Wall -march=native
./a.out
angled internal adress:
from period 1 (thru angle 1/2) to period 2 (thru angle 1/3) to period 6
*/
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# include <complex.h>
# include <string.h>
/* iXmax/iYmax = 1/2 */
# define iSide 1000
# define iXmax (2*iSide) /* height of image in pixels */
# define iYmax iSide
/* fc(z) = z*z + c */
# define Cx -1.125 /* C = Cx + Cy*i */
# define Cy 0.21650635094611
# define AR 0.0014998955 /* PixelWidth*1.5 radius of circle around attractor ZA = target set for attracting points */
# define AR2 AR*AR
//#define alfa (1-sqrt(1-4*Cx))/2 /* attracting or parabolic fixed point z = alfa */
//#define beta (1+sqrt(1-4*Cx))/2 /* repelling or parabolic fixed point z = beta */
/* 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;
}
/* find attractor ZA using forward iteration of critical point Z = 0 */
/* if denominator is >1 gives one point from attracting cycle */
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;
}
/* gives position of point (iX,iY) in 1D array ; uses also global variables */
unsigned int f(unsigned int _iX, unsigned int _iY)
{return (_iX + (iYmax-_iY-1)*iXmax );}
/* --------------------------------------------------------------------------------------------------------- */
int main(){
unsigned int denominator = 3;
unsigned int iX,iY, /* indices of 2D virtual array (image) = integer coordinate */
i, /* index of 1D array */
iLength = iXmax*iYmax;/* length of array in bytes = number of bytes = number of pixels of image * number of bytes of color */
/* world ( double) coordinate = parameter plane*/
const double dSide = 0.9;
const double ZxMin=-2*dSide;
const double ZxMax=2*dSide;
const double ZyMin=-dSide;
const double ZyMax=dSide;
double PixelWidth=(ZxMax-ZxMin)/iXmax;
double PixelHeight=(ZyMax-ZyMin)/iYmax;
/* */
double Zx, Zy; /* Z=Zx+Zy*i */
double complex ZA; /* atractor ZA = ZAx + ZAy*i */
/* */
const double EscapeRadius=80.0; /* radius of circle around origin; its complement is a target set for escaping points */
double ER2=EscapeRadius*EscapeRadius;
const int IterationMax=60,
IterationMaxBig= 1000001;
int eLastIteration, iLastIteration;
/* sobel filter */
unsigned char G, Gh, Gv;
/* color */
unsigned char color[]={255,230,180}; /* shades of gray used in image */
const unsigned int MaxColorComponentValue=255; /* color component is coded from 0 to 255 ; it is 8 bit color file */
/* dynamic 1D arrays for colors ( shades of gray ) */
unsigned char *data, *edge;
data = malloc( iLength * sizeof(unsigned char) );
edge = malloc( iLength * sizeof(unsigned char) );
if (data == NULL || edge==NULL)
{
fprintf(stderr," Could not allocate memory");
getchar();
return 1;
}
else printf(" memory is OK\n");
ZA = GiveAttractor( Cx, Cy, ER2, IterationMaxBig); /* find attractor ZA using forward iteration of critical point Z = 0 */
printf(" fill the data array \n");
for(iY=0;iY<iYmax;++iY){
Zy=ZyMin + iY*PixelHeight; /* */
if (fabs(Zy)<PixelHeight/2) Zy=0.0; /* */
printf(" row %u from %u \n",iY, iYmax);
for(iX=0;iX<iXmax;++iX){
Zx=ZxMin + iX*PixelWidth;
eLastIteration = GiveExtLastIteration(Zx, Zy, Cx, Cy, IterationMax, ER2 );
i= f(iX,iY); /* compute index of 1D array from indices of 2D array */
if ( IterationMax != eLastIteration )
{data[i]=245;} /* exterior */
else /* interior */
{ iLastIteration = GiveIntLastIteration(Zx, Zy, Cx, Cy, IterationMaxBig, AR2, creal(ZA), cimag(ZA));
data[i]=color[iLastIteration % denominator];} /* */
/* if (Zx>0 && Zy>0) data[i]=255-data[i]; check the orientation of Z-plane by marking first quadrant */
}
}
printf(" find boundaries in data array using Sobel filter\n");
for(iY=1;iY<iYmax-1;++iY){
for(iX=1;iX<iXmax-1;++iX){
Gv= data[f(iX-1,iY+1)] + 2*data[f(iX,iY+1)] + data[f(iX-1,iY+1)] - data[f(iX-1,iY-1)] - 2*data[f(iX-1,iY)] - data[f(iX+1,iY-1)];
Gh= data[f(iX+1,iY+1)] + 2*data[f(iX+1,iY)] + data[f(iX-1,iY-1)] - data[f(iX+1,iY-1)] - 2*data[f(iX-1,iY)] - data[f(iX-1,iY-1)];
G = sqrt(Gh*Gh + Gv*Gv);
i= f(iX,iY); /* compute index of 1D array from indices of 2D array */
if (G==0) {edge[i]=255;} /* background */
else {edge[i]=0;} /* boundary */
}
}
// printf(" copy boundaries from edge to data array \n");
// for(iY=1;iY<iYmax-1;++iY){
// for(iX=1;iX<iXmax-1;++iX)
// {i= f(iX,iY); /* compute index of 1D array from indices of 2D array */
// if (edge[i]==0) data[i]=0;}}
/* ---------- file -------------------------------------*/
printf(" save data array to the file \n");
FILE * fp;
char name [10]; /* name of file */
i = sprintf(name,"e%2.9f",AR); /* result (is saved in i) but is not used */
char *filename =strcat(name,".pgm");
char *comment="# C=";/* comment should start with # */
/* save image to the pgm file */
fp= fopen(filename,"wb"); /*create new file,give it a name and open it in binary mode */
fprintf(fp,"P5\n %s\n %u\n %u\n %u\n",comment,iXmax,iYmax,MaxColorComponentValue); /*write header to the file*/
fwrite(edge,iLength,1,fp); /*write image data bytes to the file in one step */
printf("File %s saved. \n", filename);
fclose(fp);
/* --------------free memory ---------------------*/
free(data);
free(edge);
return 0;
}
References
Bu dosyada gösterilen öğeler
betimlenen
Vikiveri ögesi olmayan bir değer
13 Ocak 2012
Dosya geçmişi
Dosyanın herhangi bir zamandaki hâli için ilgili tarih/saat kısmına tıklayın.
Tarih/Saat | Küçük resim | Boyutlar | Kullanıcı | Yorum | |
---|---|---|---|---|---|
güncel | 19.17, 30 Mayıs 2014 | 2.000 × 1.000 (19 KB) | JeffyP | I'm here to make the world a smaller place ☺ | |
17.27, 13 Ocak 2012 | 2.000 × 1.000 (22 KB) | Soul windsurfer |
Dosya kullanımı
Bu görüntü dosyasına bağlantısı olan sayfalar:
Küresel dosya kullanımı
Aşağıdaki diğer vikiler bu dosyayı kullanır:
- en.wikipedia.org üzerinde kullanımı
- en.wikibooks.org üzerinde kullanımı
"https://tr.wikipedia.org/wiki/Dosya:Parabolic_julia_set_c_%3D_-1.125_%2B_0.21650635094611*i.png" sayfasından alınmıştır