Last active
August 29, 2015 14:27
-
-
Save carsten-j/b97b62c5bc39136426ec to your computer and use it in GitHub Desktop.
Alternative impl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let iterate c = Seq.unfold (fun z -> Some(z ** 2.0 + c, z ** 2.0 + c)) Complex.Zero | |
let countIterations startingPoint maxIterations = | |
iterate startingPoint | |
|> Seq.truncate maxIterations | |
|> Seq.takeWhile (fun z -> z.Magnitude < 2.0) | |
|> Seq.length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment