Mandelbrot set: Difference between revisions

m
(→‎Mandelbrot Set with Julia Animation: Added: e^(-|z|)-Smoothing)
Line 5,252:
 
===Mandelbrot Set with Julia Animation===
This is aan modificationextension of the corresponding R section: e^(-|z|)-smoothing was added.
<lang julia>using Plots
gr(aspect_ratio=:equal, legend=false, dpi=250)
 
d = 800 # pixel density (= image width)
h = 600 # image height
 
x = range(-1.0, 1.0, length=d+1)
y = range(-h/d, h/d, length=h+1)
 
C = 2.0 * (x' .+ y * im) .- 0.5
Z, S = zero(C), zeros(size(C))
 
anim1 = Animation()
anim2 = Animation()
Line 5,270:
for k = 1:20
global Z = Z .^ 2 + C
global S = S + exp.(-abs.(Z))
heatmap(exp.(-abs.(Z)), c=:jet)
frame(anim1)
global S = S + exp.(-abs.(Z))
heatmap(S, c=:jet)
frame(anim2)
end
 
gif(anim1, "Mandelbrot_anim1.gif", fps=1)
gif(anim2, "Mandelbrot_anim2.gif", fps=1)</lang>
305

edits