summaryrefslogtreecommitdiffstats
path: root/src/mandelbrot.jl
blob: bde0a74736b0fef976d860323be840af8786e224 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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