Mandelbrot set: Difference between revisions
Content added Content deleted
(→Distance Estimation, Normal Maps, Mercator Maps and Perturbation Theory: Formulas adapted to the source. Long lines shortened.) |
(→Distance Estimation, Normal Maps, Mercator Maps and Deep Zoom: Formulas adapted to the source. Long lines shortened.) |
||
Line 8,975: | Line 8,975: | ||
plt.imshow(D ** 0.1, cmap=plt.cm.twilight_shifted, origin="lower") |
plt.imshow(D ** 0.1, cmap=plt.cm.twilight_shifted, origin="lower") |
||
plt.savefig(" |
plt.savefig("Mandelbrot_distance_est.png", dpi=200) |
||
N = abs(Z) > 2 # normal map (potential function) |
N = abs(Z) > 2 # normal map 1 (potential function) |
||
U = Z[N] / dZ[N] |
U = Z[N] / dZ[N] |
||
U = U / abs(U) |
|||
T[N] = np.maximum |
T[N] = np.maximum((U.real * v.real + U.imag * v.imag + height) / (1 + height), 0) |
||
plt.imshow(T ** 1.0, cmap=plt.cm.gray, origin="lower") |
plt.imshow(T ** 1.0, cmap=plt.cm.gray, origin="lower") |
||
plt.savefig(" |
plt.savefig("Mandelbrot_normal_map_1.png", dpi=200) |
||
N = abs(Z) > 2 # normal map (distance estimation) |
N = abs(Z) > 2 # normal map 2 (distance estimation) |
||
ZN, |
LN, ZN, AN, BN = np.log(abs(ZN)), Z[N], dZ[N], ddZ[N] |
||
U = ZN * |
U = ZN * AN * ((1 + LN) * np.conj(AN ** 2) - LN * np.conj(ZN * BN)) |
||
U = U / abs(U) |
|||
T[N] = np.maximum |
T[N] = np.maximum((U.real * v.real + U.imag * v.imag + height) / (1 + height), 0) |
||
plt.imshow(T ** 1.0, cmap=plt.cm.gray, origin="lower") |
plt.imshow(T ** 1.0, cmap=plt.cm.gray, origin="lower") |
||
plt.savefig(" |
plt.savefig("Mandelbrot_normal_map_2.png", dpi=200)</syntaxhighlight> |
||
A small change in the code above creates Mercator maps of the Mandelbrot set (see David Madore: [http://www.madore.org/~david/math/mandelbrot.html ''Mandelbrot set images and videos''] and Anders Sandberg: [https://www.flickr.com/photos/arenamontanus/sets/72157615740829949 ''Mercator Mandelbrot Maps'']). |
A small change in the code above creates Mercator maps of the Mandelbrot set (see David Madore: [http://www.madore.org/~david/math/mandelbrot.html ''Mandelbrot set images and videos''] and Anders Sandberg: [https://www.flickr.com/photos/arenamontanus/sets/72157615740829949 ''Mercator Mandelbrot Maps'']). |
||
Line 9,032: | Line 9,034: | ||
ax[1, 0].scatter(X[3*z:3*z+c], Y[3*z:3*z+c], s=R[0:c]**2, c=D[3*z:3*z+c]**0.3, cmap=plt.cm.nipy_spectral) |
ax[1, 0].scatter(X[3*z:3*z+c], Y[3*z:3*z+c], s=R[0:c]**2, c=D[3*z:3*z+c]**0.3, cmap=plt.cm.nipy_spectral) |
||
ax[1, 1].scatter(X[4*z:4*z+c], Y[4*z:4*z+c], s=R[0:c]**2, c=D[4*z:4*z+c]**0.2, cmap=plt.cm.nipy_spectral) |
ax[1, 1].scatter(X[4*z:4*z+c], Y[4*z:4*z+c], s=R[0:c]**2, c=D[4*z:4*z+c]**0.2, cmap=plt.cm.nipy_spectral) |
||
plt.savefig(" |
plt.savefig("Mercator_Mandelbrot_zoom.png", dpi=100)</syntaxhighlight> |
||
For deep zoom images it is sufficient to calculate a single point with high accuracy. A good approximation can then be found for all other points by means of a perturbation calculation with standard accuracy. See [https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set#Perturbation_theory_and_series_approximation Perturbation theory] (Wikipedia) and [https://gbillotey.github.io/Fractalshades-doc/math.html Mathematical background] (Fractalshades) for more details. |
For deep zoom images it is sufficient to calculate a single point with high accuracy. A good approximation can then be found for all other points by means of a perturbation calculation with standard accuracy. See [https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set#Perturbation_theory_and_series_approximation Perturbation theory] (Wikipedia) and [https://gbillotey.github.io/Fractalshades-doc/math.html Mathematical background] (Fractalshades) for more details. |