Jump to content

Mandelbrot set: Difference between revisions

→‎Mandelbrot Set with Julia Animation: Animation revised (no more white borders)
m (→‎Normalized Iteration Count, Distance Estimation and Mercator Maps: Correction: NumPy is just as fast as Julia)
(→‎Mandelbrot Set with Julia Animation: Animation revised (no more white borders))
Line 5,256:
gr(aspect_ratio=:equal, legend=false, dpi=250)
 
d, h = 800, 600 # pixel density (= image width) and image height
n, r = 40, 1000 # number of iterations and escape radius (r > 2)
h = 600 # image height
 
x = range(-1.0, 1.0, length=d+1)
Line 5,265:
Z, S = zero(C), zeros(size(C))
 
anim1animation = Animation()
anim2smoothing = Animation()
 
for k = 1:20n
global ZM = abs.(Z) .^ 2 +< Cr
Z[M] = Z[M] .^ 2 + C[M]
heatmap(exp.(-abs.(Z)), c=:jet)
frame(anim1animation)
global S[M] = S[M] + exp.(-abs.(Z[M]))
heatmap(S, c=:jet)
frame(anim2smoothing)
end
 
gif(anim1animation, "Mandelbrot_anim1Mandelbrot_animation.gif", fps=12)
gif(anim2smoothing, "Mandelbrot_anim2Mandelbrot_smoothing.gif", fps=12)</lang>
 
===Normalized Iteration Count, Distance Estimation and Mercator Maps===
305

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.