Mandelbrot set: Difference between revisions

m
Line 10,916:
 
direction, height = 45, 1.5 # direction and height of the incoming light
stripes, damping = 5.010, 2.0 # stripe density and damping parameter
 
x = np.linspace(0, 2, num=d+1)
Line 10,932:
Z[M], dZ[M], ddZ[M] = Z[M] ** 2 + C[M], 2 * Z[M] * dZ[M] + 1, 2 * (dZ[M] ** 2 + Z[M] * ddZ[M])
 
N = abs(Z) >= 2r # exteriornormal distancemap estimationeffect 1 (potential function)
D[N] = np.log(abs(Z[N])) * abs(Z[N]) / abs(dZ[N])
 
plt.imshow(D ** 0.1, cmap=plt.cm.twilight_shifted, origin="lower")
plt.savefig("Mandelbrot_distance_est.png", dpi=200)
 
N = abs(Z) > 2 # normal map effect 1 (potential function)
P, Q = S[N] / T[N], (S[N] + np.sin(stripes * np.angle(Z[N]))) / (T[N] + 1)
F = 1 - np.log2(np.log(np.abs(Z[N])) / np.log(r)) # fraction between 0 and 1 (for interpolation)
H = F * P + (Q1 - PF) * FQ * F# *height perturbation (3by -linear 2 * Finterpolation) # hermite interpolation
U = Z[N] / dZ[N] # normal vectors to the equipotential lines
U, v = U / abs(U), np.exp(direction / 180 * np.pi * 1j) # unit normal vectors and unit 2D vector
Line 10,949 ⟶ 10,943:
plt.savefig("Mandelbrot_normal_map_1.png", dpi=200)
 
N = abs(Z) >= 2r # normal map effect 2 (distance estimation)
U = Z[N] * dZ[N] * ((1 + np.log(abs(Z[N]))) * np.conj(dZ[N] ** 2) - np.log(abs(Z[N])) * np.conj(Z[N] * ddZ[N]))
U, v = U / abs(U), np.exp(direction / 180 * np.pi * 1j) # unit normal vectors and unit 2D vector
305

edits