summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-24 10:51:20 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-24 10:51:20 -0400
commit41f1bc178dbc777f0913a877bef1ef85e22ea5ce (patch)
treef258d962cc12c008fab32e1b2b18ef287e30a489
parent114422dfbb6c87c5beb7d78c52f1bffd38c3c356 (diff)
downloadjulia-fractals-41f1bc178dbc777f0913a877bef1ef85e22ea5ce.tar.gz
julia-fractals-41f1bc178dbc777f0913a877bef1ef85e22ea5ce.zip
pull the number of iterations out into a variable
-rw-r--r--fractal.jl6
1 files changed, 4 insertions, 2 deletions
diff --git a/fractal.jl b/fractal.jl
index dce606b..c12400b 100644
--- a/fractal.jl
+++ b/fractal.jl
@@ -2,6 +2,8 @@ using Tk
using Images
using ImageView
+iterations = 90
+
mandelbrot(z, c) = z.^2 + c
img = [ Color.HSV(0, 0, 0) for x=1:1000, y=1:1000 ]
@@ -10,9 +12,9 @@ z = c
imgc, imgslice = view(img)
-for i = 1:90
+for i = 1:iterations
z = mandelbrot(z, c)
- img[abs(z) .> 50] = Color.HSV(i * 4, 1, 1)
+ img[abs(z) .> 50] = Color.HSV(i * 360/iterations, 1, 1)
view(imgc, img)
end