diff options
Diffstat (limited to 'src/mandelbrot.jl')
-rw-r--r-- | src/mandelbrot.jl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mandelbrot.jl b/src/mandelbrot.jl index 614d490..bde0a74 100644 --- a/src/mandelbrot.jl +++ b/src/mandelbrot.jl @@ -1,3 +1,14 @@ -function mandelbrot(z, c) - z.^2 + c +type Mandelbrot + c::Array{Complex{Float64}, 2} + z::Array{Complex{Float64}, 2} + + Mandelbrot(imgsize) = ( + line = linspace(-2.0, 2.0, imgsize); + plane = [ x + y*im for x=line, y=line ]; + new(plane, plane) + ) +end + +function step(m::Mandelbrot) + m.z = m.z.^2 + m.c end |