Mandelbrot set: Difference between revisions

Line 8,905:
n, r = 200, 500 # number of iterations and escape radius (r > 2)
 
height, angledirection = 1.5, 45 # height factor and direction of the incoming light
v = np.exp(angledirection / 180 * np.pi * 1j) # unit 2D vector in this direction
 
x = np.linspace(0, 2, num=d+1)
Line 8,931:
U = Z[N] / dZ[N]
U = U / abs(U) # unit normal vector to the equipotential lines
T[N]S = np.maximumsin((U.real100 * vnp.realangle(U)) +/ U.imag10 * v.imag# +perturbation height) /function (1 + height), 0stripes)
T[N] = np.maximum((U.real * v.real + U.imag * v.imag + height + S) / (1 + height), 0)
 
plt.imshow(T ** 1.0, cmap=plt.cm.bone, origin="lower")
305

edits