Mandelbrot set: Difference between revisions
→Normalized Counting, Distance Estimation, Mercator Maps and Perturbation Theory: Final changes and cuts
(→Normalized Counting, Distance Estimation, Mercator Maps and Perturbation Theory: Small cuts and adjustments) |
(→Normalized Counting, Distance Estimation, Mercator Maps and Perturbation Theory: Final changes and cuts) |
||
Line 6,536:
C = 5.0e-55 .* (A' .+ B .* im)
Z,
D = zeros(size(C))
Line 6,583:
C = (.- 4.0) .* exp.((A' .+ B .* im) .* im)
Z,
D = zeros(size(C))
iteration(S,
for k in 1:n
M = abs2.(Z) .< abs2(r)
E[M], dE[M] = iteration(S[k],
Z[M], dZ[M] = S[k+1] .+ E[M], dS[k+1] .+ dE[M]
end
Line 6,615:
z = zero(c)
S = zeros(Complex{Float64}, n+1
for k in 1:n+1
S[k] = z
z = z ^ 2 + c
if abs2(z) > abs2(r)
error("
end
end
Line 6,639:
for k in 1:n
epsilon = (2 * S[index] + epsilon) * epsilon + delta
z, dz = S[index + 1] + epsilon, 2 * z * dz + 1
if abs2(z) > abs2(r)
break
end
if abs2(z) < abs2(epsilon) # rebasing when orbit is near zero
epsilon, index = z, 1
end
Line 6,656:
heatmap(D' .^ 0.025, c=:nipy_spectral)
savefig("
The MultiFloats.jl library can be used to verify the results. To do this, however, the complex exponential function must be broken down into real cosine and sine functions and these functions must be calculated with BigFloats. However, the one-off calculation with a few BigFloats before and after the loop only has a small impact on the calculation speed. Since the number pi is missing from the library, 2*pi is replaced by acos(0)*4. Although the calculation with MultiFloats is much faster than with BigFloats, it is much slower compared to the perturbation calculation.
Line 6,691:
heatmap(D' .^ 0.025, c=:nipy_spectral)
savefig("
=={{header|Kotlin}}==
|