How do I zoom in the mandelbrot set using a conical slice with angle 7/20pi

73 views Asked by At

We are trying to get the correct code that zooms in the mandelbrot set using a conical slice of 7/20pi. This is the code we've tried, but it only gives us the madelbrot set with the angle and doesn't zoom in

import numpy as np
import matplotlib.pyplot as plt

def mandelbrot_set(xmin, xmax, ymin, ymax, width, height, max_iterations):
    X, Y = np.meshgrid(np.linspace(xmin, xmax, width), np.linspace(ymin, ymax, height))
    C = X + 1j * Y
    Z = C
    M = np.zeros((height, width))
    for n in range(max_iterations):
        Z = Z**2 + C
        M[np.abs(Z) <= 2] = n
    return M

def conical_slice(angle, max_iterations):`
    min, xmax, ymin, ymax = np.array([-2, 1, -1.5, 1.5]) * np.exp(1j * angle)
    width, height = 800, 800`
    return mandelbrot_set(xmin, xmax, ymin, ymax, width, height, max_iterations)
angle = 7/20 * np.pi
max_iterations = 256
M = conical_slice(angle, max_iterations)
plt.imshow(M, cmap=bone)`
plt.axis(off)
plt.show()
0

There are 0 answers