hglmandel/06_Mandelbulb/Mandel.hs
Yann Esposito 11f3685b54 hlinted
2012-06-11 16:53:26 +02:00

13 lines
336 B
Haskell

-- The Mandelbrot function
module Mandel (mandel) where
import ExtComplex
mandel r i s nbIterations =
f (extcomplex r i s) 0 nbIterations
where
f :: ExtComplex -> ExtComplex -> Int -> Int
f _ _ 0 = 0
f c z n = if (magnitude z > 2 )
then n
else f c ((z*z)+c) (n-1)