Пример #1
0
 public void ConstruireFractale(Pixel[,] ImageScratch)
 {
     for (int x = -Largeur / 2; x < Largeur / 2; x++)
     {
         for (int y = -Hauteur / 2; y < Hauteur / 2; y++)
         {
             double   a         = (double)(x) / (double)(Largeur / 4);
             double   b         = (double)(y) / (double)(Hauteur / 4);
             Complexe C         = new Complexe(a, b);
             Complexe Z         = new Complexe(0, 0);
             int      itération = 0;
             while (itération < 100)
             {
                 Z.AuCarré();
                 Z.Ajouter(C);
                 if (Z.Norme() <= 2.0)
                 {
                     ImageScratch[x, y].Red   = 256;
                     ImageScratch[x, y].Green = 256;
                     ImageScratch[x, y].Blue  = 256;
                 }
                 else
                 {
                     break;
                 }
             }
         }
     }
 }
Пример #2
0
 public void Ajouter(Complexe C)
 {
     PartieRe += C.PartieRe;
     PartieIm += C.PartieIm;
 }