Exemplo n.º 1
0
        /// <summary>
        /// Cette méthode permet d'afficher l'ensemble de Mandelbrot
        /// </summary>
        public void Fractaleee()
        {
            int largeur_cadre = this.image.GetLength(0);
            int hauteur_cadre = this.image.GetLength(1);

            for (int i = 0; i < largeur_cadre; i++)
            {
                for (int j = 0; j < hauteur_cadre; j++)
                {
                    double   a      = (double)(i - (largeur_cadre / 2)) / (double)(largeur_cadre / 4);
                    double   b      = (double)(j - (hauteur_cadre / 2)) / (double)(hauteur_cadre / 4);
                    Complexe c      = new Complexe(a, b);
                    Complexe z      = new Complexe(0, 0);
                    int      it     = 0;
                    int      it_max = 100;
                    do
                    {
                        it++;
                        z.Carre();
                        z.Addition(c);
                    }while (it < it_max);
                    if ((it == it_max) && (z.Norme() < 6))
                    {
                        this.Image[j, i].Rouge = 0;
                        this.Image[j, i].Vert  = 0;
                        this.Image[j, i].Bleu  = 0;
                    }
                }
                Enregistrement(this.image);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Additionne des nombres complexes.
 /// </summary>
 /// <param name="c"></param>
 public void Addition(Complexe c)
 {
     x += c.x;
     y += c.y;
 }