Images, snippets, snapshots, math

View Gabriele Lami's profile on LinkedIn

giovedì 20 agosto 2009

Mandelbrot set in Haskell

import Data.Complex
gr = map(\y-> [( x:+y )|x<-[-3,-2.95..1]])[-2,-1.9..2]
px (a:+b) = magnitude(foldl (\z c ->z^2+c) 0 (take 10([((a*x):+b)|x<-[1,1..]])))
image = map((map(\el->case(px el<2)of{true->'*';_ ->'-'})))gr
main = mapM_ putStrLn ( (map(\el->show el) )image )




A first interpretation ( a little bit unsatisfactory ) of the Mandelbrot set in Haskell









Nessun commento: