hunk ./Plot.hs 26 - + hunk ./Plot.hs 28 --- From an image pixel and viewing window +-- From an image pixel and viewing window hunk ./Plot.hs 32 - let xscale = fromIntegral(x) / fromIntegral(xsize) - yscale = fromIntegral(y) / fromIntegral(ysize) + let xscale = fromIntegral x / fromIntegral xsize + yscale = fromIntegral y / fromIntegral ysize hunk ./burning_ship.hs 8 - + hunk ./burning_ship.hs 18 -main = do drawPlot drawShip imageDim mbWindow "burning_ship.png" +main = drawPlot drawShip imageDim mbWindow "burning_ship.png" hunk ./burning_ship.hs 25 -ship :: Complex Double -- Coordinate to test +ship :: Complex Double -- Coordinate to test hunk ./burning_ship.hs 31 - | otherwise = let z' = (abs(realPart(z)) :+ abs(imagPart(z)))^2 + c in - if magnitude(z') > 2 + | otherwise = let z' = (abs(realPart z) :+ abs(imagPart z))^2 + c in + if magnitude z' > 2 hunk ./burning_ship.hs 37 -colorIterations x +colorIterations x hunk ./juliaset.hs 8 - + hunk ./juliaset.hs 19 -c = (-0.423) :+ (0.745) -- Dust +c = (-0.423) :+ 0.745 -- Dust hunk ./juliaset.hs 24 -main = do drawPlot drawJulia imageDim mbWindow "juliaset.png" +main = drawPlot drawJulia imageDim mbWindow "juliaset.png" hunk ./juliaset.hs 38 - if magnitude(z') > 2 + if magnitude z' > 2 hunk ./juliaset.hs 43 -colorIterations x +colorIterations x hunk ./mandelbrot.hs 8 - + hunk ./mandelbrot.hs 18 -main = do drawPlot drawMandelbrot imageDim mbWindow "mandelbrot.png" +main = drawPlot drawMandelbrot imageDim mbWindow "mandelbrot.png" hunk ./mandelbrot.hs 32 - if magnitude(z') > 2 + if magnitude z' > 2 hunk ./mandelbrot.hs 37 -colorIterations x +colorIterations x hunk ./newtons_method.hs 8 - + hunk ./newtons_method.hs 16 -f z = (3 * z^4 - 1) --- derivative +f z = 3 * z^4 - 1 +-- derivative hunk ./newtons_method.hs 26 -main = do drawPlot drawNewton imageDim mbWindow "newtonm.png" +main = drawPlot drawNewton imageDim mbWindow "newtonm.png" hunk ./newtons_method.hs 38 - | ( abs $ magnitude(r) - magnitude(z)) > minDiff = newton r (iter + 1) + | ( abs $ magnitude r - magnitude z) > minDiff = newton r (iter + 1) hunk ./newtons_method.hs 40 - where r = z - (f z) / (f' z) + where r = z - f z / f' z hunk ./newtons_method.hs 43 -colorIterations x +colorIterations x hunk ./newtons_method.hs 45 - | otherwise = rgb (x) (x*3) (x) + | otherwise = rgb x (x*3) x hunk ./fractal-hs.cabal 7 -Maintainer: scsibug@imap.cc +Maintainer: Greg Heartsfield hunk ./fractal-hs.cabal 8 -Build-Depends: base, gd>=3000.0.0 +Build-Depends: base, gd>=3000.1.0 hunk ./fractal-hs.cabal 3 -Description: Fractal generators +Synopsis: Escape-time fractals +Description: Escape-time fractals created with Haskell and GD. + Includes mandlebrot, julia set, Newton's method, and + burning ship. Output is to PNG. hunk ./fractal-hs.cabal 8 +Category: Graphics, Math hunk ./fractal-hs.cabal 10 +Stability: Alpha hunk ./fractal-hs.cabal 13 +Cabal-Version: >= 1.2 hunk ./fractal-hs.cabal 17 -Executable: mandelbrot -Main-is: mandelbrot.hs -ghc-options: -O2 -fasm +source-repository head + type: darcs + location: http://gregheartsfield.com/repos/fractal-hs/ hunk ./fractal-hs.cabal 21 -Executable: juliaset -Main-is: juliaset.hs -ghc-options: -O2 -fasm +Executable mandelbrot + Main-is: mandelbrot.hs + ghc-options: -O2 -fasm hunk ./fractal-hs.cabal 25 -Executable: burning_ship -Main-is: burning_ship.hs -ghc-options: -O2 -fasm +Executable juliaset + Main-is: juliaset.hs + ghc-options: -O2 -fasm hunk ./fractal-hs.cabal 29 -Executable: newtons_method -Main-is: newtons_method.hs -ghc-options: -O2 -fasm +Executable burning_ship + Main-is: burning_ship.hs + ghc-options: -O2 -fasm + +Executable newtons_method + Main-is: newtons_method.hs + ghc-options: -O2 -fasm