(Mandelbrot set) A Mandelbrot set, named after Benoit Mandelbrot, is a set of points in the complex plane, defined using the following iteration:
![]()
c is a complex number and the starting point of iteration is z0 = 0. For a given c , the iteration will produce a sequence of complex numbers: {z0 , z1 ,... , zn ,...}. It can be shown that the sequence either tends to infinity or stays bounded, depending on the value of c. For example, if c is 0 , the sequence is {0, 0,...}, which is bounded. If c is i , the sequence is {0, i , −1 + i , −i , −1 + i ,...}, which is bounded. If c is 1 + i , the sequence is {0, 1 + i , 1 + 3i ,...}, which is unbounded. It is known that if the absolute value of a complex value Zi in the sequence is greater than 2, then the sequence is unbounded. The Mandelbrot set consists of the c value such that the sequence is bounded. For example, 0 and i are in the Mandelbrot set.
Write a program that prompts the user to enter a complex number c and determines if it is in the Mandelbrot set. Your program should compute z1, z2,... , z60. If none of their absolute value exceeds 2 , we assume c is in the Mandelbrot set. Of course, there is always an error, but 60 iterations usually are enough. You can use the Complex class defined in Programming Exercise or use the C++ complex class. The C++ complex class is a template class defined in the header file
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.