Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Numerics;
- using System.Text;
- using System.Threading.Tasks;
- using MathNet.Numerics;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Equation equation = new Equation();
- equation.itMax = 255;
- equation.ComputeFunction = Calculate;
- equation.ComputeIterateFunction = Iterate;
- ImageProcessor processor = new ImageProcessor(1920, 1080, 7, 7);
- processor.DrawImage(equation, "M:/Pictures/Complex/TFF/Baud4.png", false);
- }
- static Complex Calculate(Complex z)
- {
- return Complex.Add(
- new Complex(SpecialFunctions.Gamma((z.Real + 1) / 2), 0),
- Complex.Log(z));
- }
- static int Iterate(Complex c, int itMax)
- {
- Complex z = c;
- int i = 0;
- for (i = 0; i < itMax; i++)
- {
- z = Complex.Add(Complex.Pow(z, 2), c);
- }
- /*
- double mag = Math.Round(c.Magnitude);
- int real = Convert.ToInt32(mag);
- if (real < 0) real = Math.Abs(real);
- int im = Convert.ToInt32(Math.Round(c.Imaginary));
- int i;
- for (i = 0; i < itMax; i++)
- {
- if (real % 2 == 0) real /= 2;
- else real = 3*real + 1;
- if (real == 1)
- {
- break;
- }
- }
- if (i == itMax) return i;
- */
- return i;
- }
- static Complex x(double a, double b)
- {
- return new Complex(a, b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement