Mandelbrot set: Difference between revisions
Content added Content deleted
m (→Distance Estimation, Normal Maps, Mercator Maps and Deep Zoom: Minor changes (order changed)) |
(→Distance Estimation, Normal Maps, Mercator Maps and Perturbation Theory: Formulas adapted to the source. Long lines shortened.) |
||
Line 6,595: | Line 6,595: | ||
D[N] = log.(abs.(Z[N])) .* abs.(Z[N]) ./ abs.(dZ[N]) |
D[N] = log.(abs.(Z[N])) .* abs.(Z[N]) ./ abs.(dZ[N]) |
||
heatmap(D .^ 0.1, c=: |
heatmap(D .^ 0.1, c=:balance) |
||
savefig(" |
savefig("Mandelbrot_distance_est.png") |
||
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] = max. |
T[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0) |
||
heatmap(T .^ 1.0, c=:grays) |
heatmap(T .^ 1.0, c=:grays) |
||
savefig(" |
savefig("Mandelbrot_normal_map_1.png") |
||
calculation(L, Z, A, B) = Z .* A .* ((1 .+ L) .* conj.(A .^ 2) .- L .* conj.(Z .* B)) |
|||
N = abs.(Z) .> 2 # normal map (distance estimation) |
N = abs.(Z) .> 2 # normal map 2 (distance estimation) |
||
ZN, dZN, ddZN = Z[N], dZ[N], ddZ[N] |
|||
U = |
U = calculation(log.(abs.(Z[N])), Z[N], dZ[N], ddZ[N]) |
||
U = U ./ abs.(U) |
|||
T[N] = max. |
T[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0) |
||
heatmap(T .^ 1.0, c=:grays) |
heatmap(T .^ 1.0, c=:grays) |
||
savefig(" |
savefig("Mandelbrot_normal_map_2.png")</syntaxhighlight> |
||
A small change in the code above creates Mercator maps and zoom images of the Mandelbrot set. See also the album [https://www.flickr.com/photos/arenamontanus/albums/72157615740829949 Mercator Mandelbrot Maps] by Anders Sandberg. |
A small change in the code above creates Mercator maps and zoom images of the Mandelbrot set. See also the album [https://www.flickr.com/photos/arenamontanus/albums/72157615740829949 Mercator Mandelbrot Maps] by Anders Sandberg. |
||
Line 6,650: | Line 6,652: | ||
p4 = scatter(X[4z+1:4z+c,1:d], Y[4z+1:4z+c,1:d], markersize=R[1:c], marker_z=D[4z+1:4z+c,1:d].^.2) |
p4 = scatter(X[4z+1:4z+c,1:d], Y[4z+1:4z+c,1:d], markersize=R[1:c], marker_z=D[4z+1:4z+c,1:d].^.2) |
||
plot(p1, p2, p3, p4, layout=(2, 2)) |
plot(p1, p2, p3, p4, layout=(2, 2)) |
||
savefig(" |
savefig("Mercator_Mandelbrot_zoom.png")</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. |