@interact
def julia_plot(expo = slider(-10,10,0.1,2), \
iterations=slider(1,100,1,30), \
c_real = slider(-2,2,0.01,0.5), \
c_imag = slider(-2,2,0.01,0.5), \
zoom_x = range_slider(-2,2,0.01,(-1.5,1.5)), \
zoom_y = range_slider(-2,2,0.01,(-1.5,1.5))):
var('z')
I = CDF.gen()
f(z) = z^expo + c_real + c_imag*I
ff_j = fast_callable(f, vars=[z], domain=CDF)
def julia(z):
for i in range(iterations):
z = ff_j(z)
if abs(z) > 2:
return z
return z
print 'z <- z^%s + (%s+%s*I)' % (expo, c_real, c_imag)
complex_plot(julia, zoom_x,zoom_y, plot_points=200, dpi=150).show(frame=True, aspect_ratio=1)