Mandelbrot set: Difference between revisions
m
→Normal Maps, Mercator Maps and Perturbation Theory: Minor adjustments
m (→Normal Maps, Mercator Maps and Perturbation Theory: Minor adjustments) |
|||
Line 7,957:
gif(smoothing, "Mandelbrot_smoothing.gif", fps=2)</syntaxhighlight>
===Normal
This is a translation of the corresponding Python section. The Mandelbrot set is represented by distance estimation and normal maps using complex matrices (cf. Arnaud Chéritat: [https://www.math.univ-toulouse.fr/~cheritat/wiki-draw/index.php/Mandelbrot_set#Normal_map_effect ''Normal map effect'']). Note that the second derivative (ddZ) grows very fast, so the second method can only be used for small iteration numbers (n <= 400).
<syntaxhighlight lang="julia">using Plots
Line 7,989:
savefig("Mandelbrot_distance_est.png")
N = abs.(Z) .> 2 # normal map effect 1 (potential function)
U = Z[N] ./ dZ[N] # normal
U, S = U ./ abs.(U), 1 .+ sin.(100 .* angle.(U)) ./ 10 # unit
T[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ S .* height) ./ (1 + height), 0)
Line 7,997:
savefig("Mandelbrot_normal_map_1.png")
N = abs.(Z) .> 2 # normal map effect 2 (distance estimation)
normal(L, Z, A, B) = Z .* A .* ((1 .+ L) .* conj.(A .^ 2) .- L .* conj.(Z .* B))
U = normal(log.(abs.(Z[N])), Z[N], dZ[N], ddZ[N])
U = U ./ abs.(U) # unit normal
T[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0)
Line 8,090:
D[N] = log.(abs.(Z[N])) .* abs.(Z[N]) ./ abs.(dZ[N])
heatmap(D' .^ 0.
savefig("Mercator_Mandelbrot_deep_map.png")</syntaxhighlight>
|