summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-26 00:29:13 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-26 00:29:13 -0400
commitfb9498f1295089ac50c65d9ea826bc26acb521b0 (patch)
tree80bd74768058d14a2792ff913a457807d13fb1c4
parent2a174cf7a918637af3f84bf47b2f720dcbc742fe (diff)
downloadjulia-fractals-fb9498f1295089ac50c65d9ea826bc26acb521b0.tar.gz
julia-fractals-fb9498f1295089ac50c65d9ea826bc26acb521b0.zip
simplify specifying c
-rw-r--r--src/fractal.jl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fractal.jl b/src/fractal.jl
index 41977c1..eb0b496 100644
--- a/src/fractal.jl
+++ b/src/fractal.jl
@@ -6,7 +6,11 @@ type Fractal{T <: FloatingPoint}
function Fractal(imgsize, make_c = z -> z, step = (z, c) -> z.^2 + c)
line = linspace(-2.0, 2.0, imgsize)
plane = [ complex(x, y) for x=line, y=line ]
- new(plane, make_c(plane), step)
+ c = make_c(plane)
+ if !isa(c, Array)
+ c = ones(plane) .* c
+ end
+ new(plane, c, step)
end
end