Fichier:LCMJ rabbit.jpg

Le contenu de la page n’est pas pris en charge dans d’autres langues.
Une page de Wikipédia, l'encyclopédie libre.

Fichier d’origine(2 000 × 2 000 pixels, taille du fichier : 428 kio, type MIME : image/jpeg)

Ce fichier et sa description proviennent de Wikimedia Commons.

Description

Description
English: Level Curves of Escape Time for Cx=-0.12256, Cy=0.74486;The Julia set boundary itself is not drawn: we see it as the locus of points where the boundaries of level curves are especially close to each other.
Source Travail personnel
Auteur Adam majewski
Autres versions

Compare with

See also :

  • Level curves of Mandelbrot set
  • Figure 39 on page 189 from book J Milnor: Dynamics in one complex variable ( 2006 , third edition) . Milnor's figure shows Level Curves of potential ( not Escape Time)
  • "Rabbit Ears" Julia set[1]

Long description

  • this is c console program, which creates pgp file ( 8-bit color = gray scale ) in program directory. Technic of creating ppm file is based on the code of Claudio Rocchini.
  • First dynamic 1D array for 8-bit color values is created.
  • Color of points is saved in array
  • array is saved to the file

To see the file use external application ( image viewer). File was converted from pgm to jpg.

Image is created by:

  • creating Level Sets of Escape time of Fatou set
  • edge detection of Level sets. Algorithm is based on paper by M. Romera et al[2]

C source code

It is a console C program ( one file) It can be compiled under :

  • windows ( gcc thru Dev-C++ )
  • linux and mac using gcc :
gcc main.c -lm

it creates a.out file. Then run it :

./a.out

It creates ppm file in program directory. Use file viewer to see it.

/* 
c console program
 
 comments : Adam Majewski 
 fraktal.republika.pl 
*/
/* 
c console program:
 1. draws Level curves of escape time  for Fc(z)=z*z +c
 
 
 -------------------------------         
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 ( gray scale ) graphic file ,  portable pixmap file = PGM  (P5)
see http://en.wikipedia.org/wiki/Portable_pixmap
to see the file use external application ( graphic viewer)
---------------------------------
3. 
Algorithm of drawing level curves is based on paper :
Drawing the Mandelbrot set by the method of escape lines. M. Romera et al.
http://www.iec.csic.es/~miguel/Preprint3.ps
this is translations of  BASIC program of M. Romera)
 */
#include <stdio.h>
#include <math.h>
int main()
{
        const double Cx=-0.12256,Cy=0.74486;
        
       
         /* screen ( integer) coordinate */
       int iX,iY;
       const int iXmax = 10000, iXmin=0; 
       const int iYmax = 10000, iYmin=0;
       int iWidth=iXmax-iXmin+1,
       iHeight=iYmax-iYmin+1,
       /* number of bytes = number of pixels of image * number of bytes of color */
       iLength=iWidth*iHeight*1,/* 1 bytes of color  */
       index; /* of array */
       
       /* world ( double) coordinate = dynamic plane ( z-plane) */
      
       const double ZxMin=-2.5;
       const double ZxMax=2.5;
       const double ZyMin=-2.5;
       const double ZyMax=2.5;
       /* */
       double PixelWidth=(ZxMax-ZxMin)/iXmax;
       double PixelHeight=(ZyMax-ZyMin)/iYmax;
       /* color component ( R or G or B) is coded from 0 to 255 */
       /* it is 8 bit color RGB file */
       const int MaxColorComponentValue=255; 
       FILE * fp;
       char *filename="LCMJ_rabbit.pgm";
       char *comment="# Cx=-0.12256, Cy=0.74486; EscapeRadius=1000 IterationMax=200;";/* comment should start with # */
       
       /* Z=Zx+Zy*i  ;   Z0 = 0 */
       double Zx, Zy;
       double Zx2, Zy2; /* Zx2=Zx*Zx;  Zy2=Zy*Zy  */
       /*  */
       int Iteration, PreviousIter;
       const int IterationMax=200;
       /* bail-out value , radius of circle ;  */
       const double EscapeRadius=1000;
       double ER2=EscapeRadius*EscapeRadius;
       /* dynamic 1D array for 8-bit color values */    
       unsigned char *array;
       /*-------------------------------------------------------------------*/
       array = malloc( iLength * sizeof(unsigned char) );
       if (array == NULL)
       {
       fprintf(stderr,"Could not allocate memory");
       getchar();
       return 1;
       }
       else 
            {   fprintf(stderr,"I'm working. Please wait (:-))\n ");
                /* fill the data array with white points */       
            for(index=0;index<iLength-1;++index) array[index]=255;
            }
       /* ---------------------------------------------------------------*/
       
       
       
       
       /* first coat of paint */
       for(iY=0;iY<iYmax;iY++)
       {
            
            
            for(iX=0;iX<iXmax;iX++)
            {         /* compute Zx and Zy for each point */
                       Zy=ZyMin + iY*PixelHeight;
                       if (fabs(Zy)< PixelHeight/2) Zy=0.0; /*  */
                       Zx=ZxMin + iX*PixelWidth;
                       /* initial value of orbit  */
                       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;
                       };
                       /* plot point of Level Curve */
                       if (iX!=0 && Iteration!=PreviousIter)
                       { 
                          array[((iYmax-iY-1)*iXmax+iX)]=0;
                          PreviousIter=Iteration;                       
                       }
                 
                        
               }
       }
       
       /* second coat of paint */
       for(iX=0;iX<iXmax;iX++)
            {         
            
            for(iY=0;iY<iYmax;iY++)
              {/* compute Zx and Zy for each point */
               Zx=ZxMin + iX*PixelWidth;
               Zy=ZyMin + iY*PixelHeight;
               if (fabs(Zy)< PixelHeight/2) Zy=0.0; /*  */
            
            
                       /* initial value of orbit = Z */
                       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;
                       };
                       /* plot point of Level Curve */
                       if (iX!=0 && Iteration!=PreviousIter)
                       { 
                          array[((iYmax-iY-1)*iXmax+iX)]=0;
                          PreviousIter=Iteration;                       
                       }
                 
                        
               }
       }
       
       
       /* write the whole data array to ppm file in one step */      
     /*create new file,give it a name and open it in binary mode  */
     fp= fopen(filename,"wb"); /* b -  binary mode */
     if (fp == NULL){ fprintf(stderr,"file error"); }
           else
           {
           /*write ASCII header to the file*/
           fprintf(fp,"P5\n %s\n %d\n %d\n %d\n",comment,iXmax,iYmax,MaxColorComponentValue);
           /*write image data bytes to the file*/
           fwrite(array,iLength ,1,fp);
           fclose(fp);
           fprintf(stderr,"file saved\n");
           getchar();
           }
     free(array);
       
       getchar();
       return 0;
}

References

  1. Keenan Crane - Ray Tracing Quaternion Julia Sets on the GPU
  2. Drawing the Mandelbrot set by the method of escape lines. M. Romera et al.

Conditions d’utilisation

Moi, en tant que détenteur des droits d’auteur sur cette œuvre, je la publie sous les licences suivantes :
w:fr:Creative Commons
paternité partage à l’identique
Ce fichier est disponible selon les termes de la licence Creative Commons Attribution – Partage dans les Mêmes Conditions 3.0 (non transposée).
Vous êtes libre :
  • de partager – de copier, distribuer et transmettre cette œuvre
  • d’adapter – de modifier cette œuvre
Sous les conditions suivantes :
  • paternité – Vous devez donner les informations appropriées concernant l'auteur, fournir un lien vers la licence et indiquer si des modifications ont été faites. Vous pouvez faire cela par tout moyen raisonnable, mais en aucune façon suggérant que l’auteur vous soutient ou approuve l’utilisation que vous en faites.
  • partage à l’identique – Si vous modifiez, transformez, ou vous basez sur cette œuvre, vous devez distribuer votre contribution sous la même licence ou une licence compatible avec celle de l’original.
GNU head Vous avez la permission de copier, distribuer et modifier ce document selon les termes de la GNU Free Documentation License version 1.2 ou toute version ultérieure publiée par la Free Software Foundation, sans sections inaltérables, sans texte de première page de couverture et sans texte de dernière page de couverture. Un exemplaire de la licence est inclus dans la section intitulée GNU Free Documentation License.
Vous pouvez choisir l’une de ces licences.

Légendes

Ajoutez en une ligne la description de ce que représente ce fichier

Éléments décrits dans ce fichier

dépeint

Historique du fichier

Cliquer sur une date et heure pour voir le fichier tel qu'il était à ce moment-là.

Date et heureVignetteDimensionsUtilisateurCommentaire
actuel4 juin 2008 à 14:45Vignette pour la version du 4 juin 2008 à 14:452 000 × 2 000 (428 kio)Soul windsurfer{{Information |Description= |Source= |Date= |Author= |Permission= |other_versions= }}
4 juin 2008 à 14:21Vignette pour la version du 4 juin 2008 à 14:2110 000 × 10 000 (3,99 Mio)Soul windsurfer{{Information |Description=Level Curves of Escape Time for Cx=-0.12256, Cy=0.74486; |Source=Own work by uploader |Date= |Author=Adam majewski |Permission= |other_versions= }} {{ImageUpload|basic}}

La page suivante utilise ce fichier :

Usage global du fichier

Métadonnées