Exemplo n.º 1
0
 protected void changeSelectedFunc(ComplexFunctions.ComplexFn func, string functionName = "")
 {
     timer1.Enabled    = false;
     Text              = "Fractal Explorer " + functionName;
     SelectedComplexFn = func;
     MaxIterations     = 1; //Reset resolution
     EnsureProperAspect();
     this.Invalidate();
     timer1.Enabled = true;
 }
Exemplo n.º 2
0
        public int IterateMandelbrotPoint(Complex c, int maxIterations, double bailout, ComplexFunctions.ComplexFn func)
        {
            //Iterate a single point through a complex function, returning number of iterations (up to the max)
            //it takes to escape off beyond the bailout limit
            int     iterations = 0;
            Complex Z          = new Complex(0, 0);

            while (Complex.Abs(Z) < bailout && iterations < maxIterations)
            {
                Z = func(Z) + c;
                iterations++;
            }
            return(iterations);
        }
Exemplo n.º 3
0
 public int IterateMandelbrotPoint(PointF point, int maxIterations, double bailout, ComplexFunctions.ComplexFn func)
 {
     return(IterateMandelbrotPoint(new Complex(point.X, point.Y), maxIterations, bailout, func));
 }