public SequentialMandelbrot(float width, float height, int rows, int columns, ComplexNumber center)
 {
     Width   = width;
     Height  = height;
     Rows    = rows;
     Columns = columns;
     Center  = center;
 }
Ejemplo n.º 2
0
 public static float ComputeColumn(this ComplexNumber center, int col, float height, int rows)
 => center.ImaginaryPart - height / 2.0f + col * height / rows;
Ejemplo n.º 3
0
 public static float ComputeRow(this ComplexNumber center, int row, float width, int columns)
 => center.RealPart - width / 2.0f + row * width / columns;
Ejemplo n.º 4
0
 public static ComplexNumber MultiplyWith(this ComplexNumber n1, ComplexNumber n2)
 => new ComplexNumber(n1.RealPart * n2.RealPart - n1.ImaginaryPart * n2.ImaginaryPart,
                      n1.RealPart * n2.ImaginaryPart + n1.ImaginaryPart * n2.RealPart);
Ejemplo n.º 5
0
 public static ComplexNumber AddTo(this ComplexNumber n1, ComplexNumber n2)
 => new ComplexNumber(n1.RealPart + n2.RealPart, n1.ImaginaryPart + n2.ImaginaryPart);
Ejemplo n.º 6
0
 public static double Magnitude(this ComplexNumber number)
 => Math.Sqrt(number.RealPart * number.RealPart * number.ImaginaryPart * number.ImaginaryPart);