summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-24 11:14:49 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-24 11:14:49 -0400
commit5d6d74da6c8b2114efd7127666442a388f7f1389 (patch)
tree48782cd83192ddf0b66f4d31901994479f874c9c
parent41f1bc178dbc777f0913a877bef1ef85e22ea5ce (diff)
downloadjulia-fractals-5d6d74da6c8b2114efd7127666442a388f7f1389.tar.gz
julia-fractals-5d6d74da6c8b2114efd7127666442a388f7f1389.zip
also factor out the image size
-rw-r--r--fractal.jl10
1 files changed, 7 insertions, 3 deletions
diff --git a/fractal.jl b/fractal.jl
index c12400b..d1c1c13 100644
--- a/fractal.jl
+++ b/fractal.jl
@@ -3,12 +3,16 @@ using Images
using ImageView
iterations = 90
+imgsize = 1000
mandelbrot(z, c) = z.^2 + c
-img = [ Color.HSV(0, 0, 0) for x=1:1000, y=1:1000 ]
-c = [ x + y*im for x=linspace(-2, 2, 1000), y=linspace(-2, 2, 1000) ]
-z = c
+img = [ Color.HSV(0, 0, 0) for x=1:imgsize, y=1:imgsize ]
+c = [
+ x + y*im
+ for x=linspace(-2.0, 2.0, imgsize), y=linspace(-2.0, 2.0, imgsize)
+]
+z = c
imgc, imgslice = view(img)