Mandelbrot set: Difference between revisions
Content added Content deleted
(→Normalized Counting, Distance Estimation, Mercator Maps and Perturbation Theory: Added original source for rebasing and avoided millions of unnecessary abs2(r) calculations) |
|||
Line 6,683: | Line 6,683: | ||
savefig("Mercator_Mandelbrot_deep_map.png")</lang> |
savefig("Mercator_Mandelbrot_deep_map.png")</lang> |
||
Another approach to reduce the glitches is the so-called ''rebasing''. See [https://gbillotey.github.io/Fractalshades-doc/math.html#avoiding-loss-of-precision Avoiding loss of precision] (Fractalshades) for details. |
Another approach to reduce the glitches is the so-called ''rebasing''. See [https://gbillotey.github.io/Fractalshades-doc/math.html#avoiding-loss-of-precision Avoiding loss of precision] (Fractalshades) and [https://fractalforums.org/fractal-mathematics-and-new-theories/28/another-solution-to-perturbation-glitches/4360 Another solution to perturbation glitches] (Fractalforums) for details. |
||
<lang julia>using Plots |
<lang julia>using Plots |
||
gr(aspect_ratio=:equal, axis=true, ticks=true, legend=false, dpi=200) |
gr(aspect_ratio=:equal, axis=true, ticks=true, legend=false, dpi=200) |
||
Line 6,717: | Line 6,717: | ||
D = zeros(size(C)) |
D = zeros(size(C)) |
||
abs2_r = abs2(r) |
|||
for i in 1:h+1, j in 1:d+1 |
for i in 1:h+1, j in 1:d+1 |
||
z, dz, epsilon = Z[i, j], dZ[i, j], E[i, j] |
z, dz, epsilon = Z[i, j], dZ[i, j], E[i, j] |
||
Line 6,723: | Line 6,724: | ||
epsilon = (2 * S[index] + epsilon) * epsilon + delta |
epsilon = (2 * S[index] + epsilon) * epsilon + delta |
||
z, dz = S[index + 1] + epsilon, 2 * z * dz + 1 |
z, dz = S[index + 1] + epsilon, 2 * z * dz + 1 |
||
abs2_z, abs2_epsilon = abs2(z), abs2(epsilon) |
|||
⚫ | |||
⚫ | |||
elseif abs2_z < abs2_r |
|||
⚫ | |||
⚫ | |||
break |
break |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
end |
end |
||
end |
end |
||
Line 6,738: | Line 6,740: | ||
heatmap(D' .^ 0.025, c=:nipy_spectral) |
heatmap(D' .^ 0.025, c=:nipy_spectral) |
||
savefig(" |
savefig("Mercator_Mandelbrot_base_map.png")</lang> |
||
The images can be verified by a (slow) calculation with BigFloats. There are libraries that are faster than BigFloats, for example DoubleFloats.jl and MultiFloats.jl. Unfortunately, the precision of the DoubleFloats is not sufficient, and only the double MultiFloats (Float64x2) are fast. For deep zoom images you need at least triple or quadruple MultiFloats (Float64x3, Float64x4), but |
The images can be verified by a (slow) calculation with BigFloats. There are libraries that are faster than BigFloats, for example DoubleFloats.jl and MultiFloats.jl. Unfortunately, the precision of the DoubleFloats is not sufficient, and only the double MultiFloats (Float64x2) are fast. For deep zoom images you need at least triple or quadruple MultiFloats (Float64x3, Float64x4), but these are slower than BigFloats. |
||
<lang julia>using Plots |
<lang julia>using Plots |
||
gr(aspect_ratio=:equal, axis=true, ticks=true, legend=false, dpi=200) |
gr(aspect_ratio=:equal, axis=true, ticks=true, legend=false, dpi=200) |
||
Line 6,773: | Line 6,775: | ||
heatmap(D' .^ 0.025, c=:nipy_spectral) |
heatmap(D' .^ 0.025, c=:nipy_spectral) |
||
savefig(" |
savefig("Mercator_Mandelbrot_big_map.png")</lang> |
||
=={{header|Kotlin}}== |
=={{header|Kotlin}}== |