Mandelbrot set: Difference between revisions
Content added Content deleted
m (→Normalized Iteration Count, Distance Estimation and Mercator Maps: Order of algorithms changed) |
(→Mandelbrot Set with Julia Animation: Added: e^(-|z|)-Smoothing) |
||
Line 5,252: | Line 5,252: | ||
===Mandelbrot Set with Julia Animation=== |
===Mandelbrot Set with Julia Animation=== |
||
This is |
This is a modification of the corresponding R section. |
||
<lang julia>using Plots |
<lang julia>using Plots |
||
gr(aspect_ratio=:equal, legend=false, dpi=250) |
gr(aspect_ratio=:equal, legend=false, dpi=250) |
||
d = 800 # pixel density (= image width) |
d = 800 # pixel density (= image width) |
||
h = 600 # image height |
h = 600 # image height |
||
x = range(-1, 1, length=d+1) |
x = range(-1.0, 1.0, length=d+1) |
||
y = range(-h/d, h/d, length=h+1) |
y = range(-h/d, h/d, length=h+1) |
||
C = 2.0 * (x' .+ y * im) .- 0.5 |
C = 2.0 * (x' .+ y * im) .- 0.5 |
||
Z = zero(C) |
Z, S = zero(C), zeros(size(C)) |
||
⚫ | |||
anim2 = Animation() |
|||
⚫ | |||
for k = 1:20 |
for k = 1:20 |
||
global Z = Z .^ 2 + C |
global Z = Z .^ 2 + C |
||
global S = S + exp.(-abs.(Z)) |
|||
heatmap(exp.(-abs.(Z)), c=:jet) |
heatmap(exp.(-abs.(Z)), c=:jet) |
||
frame( |
frame(anim1) |
||
heatmap(S, c=:jet) |
|||
frame(anim2) |
|||
end |
end |
||
gif( |
gif(anim1, "Mandelbrot_anim1.gif", fps=1) |
||
gif(anim2, "Mandelbrot_anim2.gif", fps=1)</lang> |
|||
===Normalized Iteration Count, Distance Estimation and Mercator Maps=== |
===Normalized Iteration Count, Distance Estimation and Mercator Maps=== |