API reference

mandelbrot(c, max_iter) int[source]

Computes the number of iterations required for the complex number c to escape the Mandelbrot set.

Args:

c (complex): The complex number to test. max_iter (int): The maximum number of iterations to perform.

Returns:

int: The number of iterations required for c to escape the Mandelbrot set, or 0 if it does not escape within max_iter iterations.

mandelbrot_set(xmin, xmax, ymin, ymax, width, height, max_iter) tuple[source]

Computes the Mandelbrot set for a given range of complex plane coordinates.

Args:

xmin (float): The minimum value of the x-axis. xmax (float): The maximum value of the x-axis. ymin (float): The minimum value of the y-axis. ymax (float): The maximum value of the y-axis. width (int): The number of pixels in the x-axis. height (int): The number of pixels in the y-axis. max_iter (int): The maximum number of iterations to compute the Mandelbrot set.

Returns:

tuple: A tuple containing the x-axis values, y-axis values, and the computed pixels.

plot_mandelbrot(x, y, pixels) None[source]

Plots the Mandelbrot set using the given pixel values.

Args:

x (numpy.ndarray): Array of x-coordinates. y (numpy.ndarray): Array of y-coordinates. pixels (numpy.ndarray): Array of pixel values.

Returns:

None