From fb9498f1295089ac50c65d9ea826bc26acb521b0 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 26 Oct 2014 00:29:13 -0400 Subject: simplify specifying c --- src/fractal.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-54-g00ecf