Mandelbrot set: Difference between revisions
Content added Content deleted
Basicgames (talk | contribs) |
(→Normal Maps, Mercator Maps and Deep Zoom Images: Added stripes) |
||
Line 8,905: | Line 8,905: | ||
n, r = 200, 500 # number of iterations and escape radius (r > 2) |
n, r = 200, 500 # number of iterations and escape radius (r > 2) |
||
height, |
height, direction = 1.5, 45 # height factor and direction of the incoming light |
||
v = np.exp( |
v = np.exp(direction / 180 * np.pi * 1j) # unit 2D vector in this direction |
||
x = np.linspace(0, 2, num=d+1) |
x = np.linspace(0, 2, num=d+1) |
||
Line 8,931: | Line 8,931: | ||
U = Z[N] / dZ[N] |
U = Z[N] / dZ[N] |
||
U = U / abs(U) # unit normal vector to the equipotential lines |
U = U / abs(U) # unit normal vector to the equipotential lines |
||
S = np.sin(100 * np.angle(U)) / 10 # perturbation function (stripes) |
|||
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") |
plt.imshow(T ** 1.0, cmap=plt.cm.bone, origin="lower") |