# Mandelbrot module
def inMandelbrotSet(point):
"""
True iff point is in the Mandelbrot Set
"""
X, t = 0 + 0j, 0
while (t < 30):
if abs(X) >= 2: return 0
X, t = X ** 2 + point, t + 1
return 1
Previous slide | Next slide | Back to first slide | View graphic version |