Reference no: EM132173786
USING PYTHON
1.) Create a function that will determine if within a given number of iterations (maxiter) if a given complex number is in or out of the Mandelbrot Set. It will be in the set if the distance of the function to the origin <= 4 at maxiter: It will out of the set if the distance exceeds 4 at less than maxiter iterations. The function should be structured as follows:
def mandelbrot(c,maxiter=80):
""" Takes Seed and Applies Mandlebrot Recursion until either Maximum Iterations are encountered or until We Exit Mandelbrot Set with diestance >=4. Here c is the test Complex Number"""
return c.count
c) Create a function that will tessellate the complex domain between [-2,2] (real) and [-2,2] imaginary. The function should return a list of tuples of real and imaginary coordinates. Try to use a generator.
d) Create a function that will test whether the complex numbers in the list of tuples are in or are out of the Mandelbrot set.
e) Test your code in parts (a-d) and identify complex numbers within defined by the tessellation that are in the Mandelbrot set. Let the Maximum number of iterations be 80 and let there be 100 points in the x (real) and y (imaginary) directions.
f) Plot out the Mandelbrot set generated in part (E). Only plot out those coordinates that are in the set.